DCMTK v3.6.0 and ZLIB v1.2.5 linker errors (VS 2010)

Compilation and installation of DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
wollet88
Posts: 38
Joined: Fri, 2008-03-28, 11:07

DCMTK v3.6.0 and ZLIB v1.2.5 linker errors (VS 2010)

#1 Post by wollet88 »

Hi all,

I'm using Visual Studio 2010.
I'm trying to compile DCMTK v3.6.0 with ZLIB v1.2.5.
I need to obtain 4 set of libraries (i.e. Win32MD, Win32MT, Win64MD, Win64MT).
I already compiled ZLIB-MD-32, ZLIB-MT-32, ZLIB-MD-64, ZLIB-MT-64 with success.
I created DCMTK-MD-32 VS 2010 solution, DCMTK-MT-32 VS 2010 solution, DCMTK-MD-64 VS 2010 solution and DCMTK-MT-64 VS 2010 solution. Pointing to the correct ZLIB library.
I'm able to compile DCMTK-MD-64 and DCMTK-MT-64.
I encounter linker errors compiling DCMTK-MD-32 and DCMTK-MT-32.

40>dcmdata.lib(dcistrmz.obj) : error LNK2019: unresolved external symbol _inflateInit2_ referenced in function "public: __thiscall DcmZLibInputFilter::DcmZLibInputFilter(void)" (??0DcmZLibInputFilter@@QAE@XZ)
40>dcmdata.lib(dcistrmz.obj) : error LNK2019: unresolved external symbol _inflateInit_ referenced in function "public: __thiscall DcmZLibInputFilter::DcmZLibInputFilter(void)" (??0DcmZLibInputFilter@@QAE@XZ)
40>dcmdata.lib(dcistrmz.obj) : error LNK2019: unresolved external symbol _inflateEnd referenced in function "public: virtual __thiscall DcmZLibInputFilter::~DcmZLibInputFilter(void)" (??1DcmZLibInputFilter@@UAE@XZ)
40>dcmdata.lib(dcistrmz.obj) : error LNK2019: unresolved external symbol _inflate referenced in function "private: __int64 __thiscall DcmZLibInputFilter::decompress(void const *,__int64)" (?decompress@DcmZLibInputFilter@@AAE_JPBX_J@Z)
40>dcmdata.lib(dcostrmz.obj) : error LNK2019: unresolved external symbol _deflateInit2_ referenced in function "public: __thiscall DcmZLibOutputFilter::DcmZLibOutputFilter(void)" (??0DcmZLibOutputFilter@@QAE@XZ)
40>dcmdata.lib(dcostrmz.obj) : error LNK2019: unresolved external symbol _deflateEnd referenced in function "public: virtual __thiscall DcmZLibOutputFilter::~DcmZLibOutputFilter(void)" (??1DcmZLibOutputFilter@@UAE@XZ)
40>dcmdata.lib(dcostrmz.obj) : error LNK2019: unresolved external symbol _deflate referenced in function "private: __int64 __thiscall DcmZLibOutputFilter::compress(void const *,__int64,bool)" (?compress@DcmZLibOutputFilter@@AAE_JPBX_J_N@Z)

I'm sure the linker is pointing the correct ZLIB library.

Any help is appreciated.

Thank you and best regards

Michael Onken
DCMTK Developer
Posts: 2051
Joined: Fri, 2004-11-05, 13:47
Location: Oldenburg, Germany
Contact:

#2 Post by Michael Onken »

Hi,

this does not look like the error you get when you have the wrong version of ZLIB (i.e. MD instead of MT or the like), but it looks that you do not link ZLIB at all! Or, you link with ZLIB but the linker order is wrong (it is significant!): Add ZLIB after ofstd oflog and dcmdata.

Michael

wollet88
Posts: 38
Joined: Fri, 2008-03-28, 11:07

#3 Post by wollet88 »

Hi Michael,

thank you for the reply.
I checked the linking order and it is correct.

As an additional information I can say that using the ZLIB library compiled 2 years ago (v1.2.3) on Visual Studio 2005 I obtain a lot of warnings but non linking errors. It seems something is strange in this ZLIB 32 bit compiled by VS 2010.

I checked the zlibstat project settings and all seems to be correct. It's a big headache!

Regards

J. Riesmeier
DCMTK Developer
Posts: 2506
Joined: Tue, 2011-05-03, 14:38
Location: Oldenburg, Germany
Contact:

#4 Post by J. Riesmeier »

What about using the pre-compiled DCMTK Windows support libraries?

wollet88
Posts: 38
Joined: Fri, 2008-03-28, 11:07

#5 Post by wollet88 »

This solved the issue.
So I think something is wrong in the VS 2010 solution provided into "contrib" folder of the zlib v1.2.5 package.
How have ZLIB libraries in the ZIP package been compiled?

Michael Onken
DCMTK Developer
Posts: 2051
Joined: Fri, 2004-11-05, 13:47
Location: Oldenburg, Germany
Contact:

#6 Post by Michael Onken »

Hi,

I can't tell exactly since the guy that did this here at OFFIS for DCMTK 3.6.0 is not available anymore. However, earlier we compiled ZLIB on the commandline, using nmake. This needs some adaptions of the ZLIB sources in order to use the correct compiler flags. Also, MASM32 has to be installed.

Michael

J. Riesmeier
DCMTK Developer
Posts: 2506
Joined: Tue, 2011-05-03, 14:38
Location: Oldenburg, Germany
Contact:

#7 Post by J. Riesmeier »

We do have detailed technical instructions on how the support libraries on our server have been created, however, this documentation is in German language only :(

wollet88
Posts: 38
Joined: Fri, 2008-03-28, 11:07

#8 Post by wollet88 »

I solved the issue. The best way is not to use "contrib" project.
I used CMake and created my own VCProj2010 solutions compiling them I obtained the working libs 32MD, 32MT, 64MD, 64MT.

Regards

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest