views:

285

answers:

2

Hi there, I'm devdeloping a DLL in VS2008. When I examine the DLL in Dependency Walker, I can see a dependency on zlib1.dll. How can I find out where this comes from? My DLL is (statically) linked against HDF5.lib, HDF5_CPP.lib, and GSL.lib. I'm not including any zlib headers, so I'm a bit clueless about this. I know HDF5 depends on zlib, but I tried with the precompiled HDF5 as well as self-compiled HDF5, both to no avail.

The thing is I want to make distribution as easy as possible; that's why I link statically against all libraries I use. Funny thing is, I do link against zlib1.lib; no clue why zlib1.dll is then still a dependency.

Any ideas? Thanks!

+1  A: 

Follow the tree within the depends tools. The right hand tree show the "tree" of module dependency. Click zlib1.dll in that tree and in the top right hand you will have a list of functions that are being used by the module that links to it. Search in your project to see where you are using them.

Simon Featherstone
A: 

zlib1.lib is the dll lib, not the static lib for zlib. You need to obtain the and build the static lib part of the zlib distribution. I havn't built zlib... but some other projects have a xxx.lib and an xxxlib.lib, with the second form being the 'proper' static lib.

On /MT: /MT only effects the c-runtime selection: /MT adds a linker dependency to libc.lib - which statically links the c-runtime into your binary. conversely /MD adds a linker dependency to msvcrt.lib (a lib file) that contains references to msvcr90.dll

Chris Becke