Building DCMTK 3.6 with PNG 1.5.1

Compilation and installation of DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
Bob666
Posts: 4
Joined: Mon, 2011-02-07, 14:26

Building DCMTK 3.6 with PNG 1.5.1

#1 Post by Bob666 »

Hi all

I can't build DCMTK 3.6.0 with the new PNG 1.5.1 on Win7 x64. If I use PNG 1.4, there's no problem. The problem is, 3 projects can't link because they can't find the png functions:

Code: Select all

1>dcmimage.lib(dipipng.obj) : error LNK2001: unresolved external symbol png_write_end
1>dcmimage.lib(dipipng.obj) : error LNK2001: unresolved external symbol png_write_image
1>dcmimage.lib(dipipng.obj) : error LNK2001: unresolved external symbol png_write_info
1>dcmimage.lib(dipipng.obj) : error LNK2001: unresolved external symbol png_set_tIME
1>dcmimage.lib(dipipng.obj) : error LNK2001: unresolved external symbol png_convert_from_time_t
1>dcmimage.lib(dipipng.obj) : error LNK2001: unresolved external symbol png_set_text
1>dcmimage.lib(dipipng.obj) : error LNK2001: unresolved external symbol png_set_IHDR
1>dcmimage.lib(dipipng.obj) : error LNK2001: unresolved external symbol png_init_io
1>dcmimage.lib(dipipng.obj) : error LNK2001: unresolved external symbol png_set_longjmp_fn
1>dcmimage.lib(dipipng.obj) : error LNK2001: unresolved external symbol png_destroy_write_struct
1>dcmimage.lib(dipipng.obj) : error LNK2001: unresolved external symbol png_create_info_struct
1>dcmimage.lib(dipipng.obj) : error LNK2001: unresolved external symbol png_create_write_struct
1>dcmimage.lib(dipipng.obj) : error LNK2001: unresolved external symbol png_access_version_number
1>D:\CMake_Build\DCMTK\dcmjpeg\apps\Release\dcmj2pnm.exe : fatal error LNK1120: 13 unresolved externals
The library name and path are correct in the linker settings... Has anyone a solution for this?

Thank you
Robert

Jörg Riesmeier
ICSMED DICOM Services
ICSMED DICOM Services
Posts: 2217
Joined: Fri, 2004-10-29, 21:38
Location: Oldenburg, Germany

#2 Post by Jörg Riesmeier »

No, we haven't tried libpng 1.5.1 yet. However, I can't imagine that the authors changed the complete API. Did you compile libpng 1.4.x with the same compiler settings?

Bob666
Posts: 4
Joined: Mon, 2011-02-07, 14:26

#3 Post by Bob666 »

No, I don't think they changed everything, the made the API more consistent, but there's also a new header file to include.. So there are some changes...

Yes, I compiled it more or less the same way, the compiler and linker settings should be the same and should match DCMTK.

Chung-Yueh Lien
Posts: 61
Joined: Wed, 2010-05-19, 09:27
Location: Taipei, Taiwan

#4 Post by Chung-Yueh Lien »

Hi, I just make a test to create the win32 libaray of PNG-1.5.1 and compile with DCMTk 3.6.0. There is no such a problem. Please check the settings of scripts/makefile.vcwin32 in PNG project. Because the linking process needs pnglibconf.h which is automatically created in make process. However, there is a little bit error in default. You can fix it by following steps.

Change this line in makefile

Code: Select all

cp scripts/pnglibconf.h.prebuilt $@
as:

Code: Select all

copy /b scripts\pnglibconf.h.prebuilt$@
as well as set the path of zlib correctly and then type:

Code: Select all

nmake /f scripts\makefile.vcwin32
Finally, you will create the new library that can be used in DCMTK-3.6.0.:wink:

Bob666
Posts: 4
Joined: Mon, 2011-02-07, 14:26

#5 Post by Bob666 »

Hi

Thanks for the tipps, I solved it with using CMake to create solution files instead of using the solution files provided by libpng... looks like a compiler or linker setting wasn't as DCMTK wants it to be...

Thanks to all

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest