[Zlib-devel] libzdll.a -> libz.dll.a rename (was: Re: zlib 1.2.3.5 available for testing)

Pedro Alves alves.ped at gmail.com
Tue Jan 26 06:36:16 EST 2010


[sorry for the late reply, been traveling]

On Sunday 17 January 2010 11:57:26, Vincent Torri wrote:

> > Usually, the import library on Windows are name libname.dll.a
> >
> > Is there a reason to name zlib one 'libzdll.a' (without the . before dll) ?
> 
> I send that mail again because i think that it is important. On Windows 
> (mingw or cygwin), the import lib that is detected is libxxx.dll.a and not 
> libxxxdll.a

This change will break people's current build machineries.

The only reason I can think of (and valid one) things were named
that way, was so that you can have both static zlib and the
import lib in the same directory, and be able to select which
to link against by either specifying -lz (static),
or -lzdll (import lib, dll).

The second reason is following the "official" zlib dll/import lib
built with MSVC.  Notice how in the compiled DLL of the current release,
downloadable from zlib's homepage <http://www.zlib.net/zlib123-dll.zip>,
which is built with Microsoft Visual C++ (for all I can see), the import lib
is also named .*zdll.*

  inflating: lib/zdll.exp
  inflating: lib/zdll.lib
  ^^^^^^^^^^^^^^^^^^^^^^^
  inflating: lib/zlib.def

In fact, the "USAGE.txt" file within that .zip, mentions:

> Using ZLIB1.DLL with Microsoft Visual C++
:
>  3. Add "zdll.exp" or "zdll.lib" to your project.
:
> 
> Using ZLIB1.DLL with gcc/MinGW
> ==============================
:
>    4. Add "libzdll.a" to your project, or use the -lzdll option.
                                                    ^^^^^^

And here, for example (regular google will show more usages) you
see that that is what people
use <http://www.google.com/codesearch?q=%22-lzdll%22>.

> I always has to rename that file so that ld finds it

I guess "-lzdll" would have worked for you to.  Did you
not try it?

I don't think it's a good idea to change the import lib
name, without at least more input from the community actually
using the dll.  This will be an incompatible change with previous
releases, and goes out of sync with the MSVC built zlib dll's
import lib.  Some (many?) people linking with -lz, will now link
with the dll version instead of the static version, when they
do _not_ want to.

-- 
Pedro Alves




More information about the Zlib-devel mailing list