Bug #621

windows librarys are forcing a link to ..\..\..\zlib-1.2.3\projects\visual6\blah\blah

Added by Robin Mills over 9 years ago. Updated over 9 years ago.

Status:ClosedStart date:16 Mar 2009
Priority:NormalDue date:
Assignee:Robin Mills% Done:


Target version:0.18.1


Thanks very much to Peter E from The American Museum of Natural History, New York for reporting the following issue:

| I followed your build instructions and everything went smoothly. |
| The problem is when I try to link to the resulting exiv2 lib,    |
| the linker will fail with a message saying that it cannot find   |
|                                                                  |
| ..\..\..\zlib-1.2.3\projects\visualc6\blah\blah                  |


1) #define HAVE_LIBZ 1 in src/exv_msvc.h
2) delete the directory msvc/include (this will be recopied when you build exiv2lib)
3) rebuild all


When you enable zlib support using HAVE_LIBZ, you will include the #pragma comment(lib,".....") statements into your build.
This is fine for building the exiv2 family of libraries and executables, because it implies that you can build with/without zlib without having to change the project files. Very convenient for me. Very inconvenient for Peter.

The solution (for 0.18.1)

1) exv_msvc.h now lives in exiv2\msvc\include
and is not copied during the build process.
So, there's only one copy of exv_msvc.h which you can edit!

2) exv_msvc.h no longer includes #pragma comment statements

3) all progam project files (exiv2.vcproj etc) have been updated to explitly link the appropriate zlib library

The correct linkage is:
DebugDLL: ..\..\..\zlib-1.2.3\projects\visualc6\Win32_DLL_Debug\zlib1d.lib
ReleaseDLL: ..\..\..\zlib-1.2.3\projects\visualc6\Win32_DLL_Release\zlib1.lib
Debug: ..\..\..\zlib-1.2.3\projects\visualc6\Win32_LIB_Debug\zlibd.lib
Release: ..\..\..\zlib-1.2.3\projects\visualc6\Win32_LIB_Release\zlib.lib

Associated revisions

Revision 1764
Added by Robin Mills over 9 years ago

#621: Windows build environment changes

1) exv_msvc.h moved to msvc/include/exv_msvc.h
2) exv_msvc.h no longer has #pragma comment statements to link zlib
3) project files updated to explicitly link appropriate zlib library

Revision 1767
Added by Robin Mills over 9 years ago

#621 : Windows build changes.

I discovered while doing a private build for a user that msvc/include/exv_msvc.h still contains the #pragma comment code.
I've removed that (again!) and fixed a consequential link error on exiv2lib.vcproj DebugDLL | ReleaseDLL
Rebuilt everything on VS2003/5/8 and all run the runner.bat test OK.


#1 Updated by Andreas Huggel over 9 years ago

  • Status changed from New to Resolved

#2 Updated by Andreas Huggel over 9 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF

Redmine Appliance - Powered by TurnKey Linux