[Zlib-devel] Fwd: Zlib static and dynamic libraries for Windows

Mark Adler madler at alumni.caltech.edu
Thu Oct 23 09:25:34 EDT 2003


Microsoft C users,

Attached are some suggestions on the proper options for use with  
Microsoft C.

mark


Begin forwarded message:
> From: "Alexandru Czimbor" <andru at oss.com>
> Date: Wed Oct 22, 2003  10:50:07 AM America/Los_Angeles
> To: <zlib at gzip.org>
> Subject: Zlib static and dynamic libraries for Windows
>
> Dear Sir/Madam,
>
> We are planning to use the zlib libraries from a toolkit application  
> that
> must be thread-safe.
>
> However, we noticed that the file used for building the static version  
> of the
> zlib library uses the default flag /ML, which causes the Microsoft  
> linker to
> link with "libc.lib", a single-threaded library. What is the rationale  
> for not
> using /MT, in order to link with "libcmt.lib", which is thread-safe?
>
> In addition, the dynamic version of the zlib library is built with the  
> /MT
> option. By linking it with /MD we would avoid having more than 1 copy
> of the C runtime simultaneously in memory, since /MD causes the  
> Microsoft C
> runtime DLL to be loaded at run time.
>
> For further details, please see
> http://support.microsoft.com/default.aspx?scid=http:// 
> support.microsoft.com:80/support/kb/articles/q140/5/ 
> 84.asp&NoWebContent=1
>
> As far as I could see, none of the current zlib functionality is  
> likely to cause
> problems now. However, I believe that linking with /MD is more  
> appropriate.
>
>
> Regards,
>
> Alexandru Czimbor                          Toll Free    :  
> 1-888-OSS-ASN1
> OSS Nokalva                                    International:  
> 1-732-302-0750
> Email: andru at oss.com                     Tech Support : 1-732-302-9669
> http://www.oss.com





More information about the Zlib-devel mailing list