Install external libraries (e.g. libtiff 3.9.4)

Compilation and installation of DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
Oliver Neubauer
Posts: 19
Joined: Fri, 2014-03-14, 12:43

Install external libraries (e.g. libtiff 3.9.4)

#1 Post by Oliver Neubauer »

Hi,

I´m using dcmtk 3.6.0 on Windows 7 and want to convert DICOM to TIFF images. So, I downloaded the pre-compiled libraries for Windows (ftp://dicom.offis.de/pub/dicom/offis/so ... ort_MT.zip) and built dcmtk including the tiff library using cmake according the INSTALL file.

Unfortunately, after compilation of the subproject "Install", I got the following result:

Code: Select all

========== Alles neu erstellen: 75 erfolgreich, 4 fehlerhaft, 0 übersprungen ==========
Is that normal?

I saw no files after the installation, what deal with TIFF images. Is that the right .zip file, what I downloaded from your website? Is there another possibility to convert DICOM to TIFF?

Thanks.

Best regards,

Oliver

Jan Schlamelcher
OFFIS DICOM Team
OFFIS DICOM Team
Posts: 318
Joined: Mon, 2014-03-03, 09:51
Location: Oldenburg, Germany

Re: Install external libraries (e.g. libtiff 3.9.4)

#2 Post by Jan Schlamelcher »

Hi Oliver,
Oliver Neubauer wrote:[...] I downloaded the pre-compiled libraries for Windows (ftp://dicom.offis.de/pub/dicom/offis/so ... ort_MT.zip) and built dcmtk [...]
Unfortunately, after compilation of the subproject "Install", I got the following result:

Code: Select all

========== Alles neu erstellen: 75 erfolgreich, 4 fehlerhaft, 0 übersprungen ==========
I can only assume two possible problems:
  • There is a problem with your cmake setup (possibly not, since you followed the INSTALL instructions)
  • You are compiling with a 64 bit compiler, but the support libraries are only 32 bit.
Can you provide a more detailed compiler output?

Best,
Jan

Oliver Neubauer
Posts: 19
Joined: Fri, 2014-03-14, 12:43

Re: Install external libraries (e.g. libtiff 3.9.4)

#3 Post by Oliver Neubauer »

Hi Jan,
You are compiling with a 64 bit compiler, but the support libraries are only 32 bit.
Ok, I built dcmtk with visual studio 2012 ultimate. This is maybe a problem. So, I tried to build dcmtk with visual studio 2010 express (with 32-bit-compiler). After selecting the entry "Visual Studio 2010" in the cmake gui, I got the following error:

Code: Select all

CMake Error at C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:61 (message):
  The C compiler "C:/Program Files (x86)/Microsoft Visual Studio
  10.0/VC/bin/cl.exe" is not able to compile a simple test program.
Do you know this error? What can I do to solve this problem? Sorry for posting this problem here.

Thanks.

Best regards,

Oliver

Oliver Neubauer
Posts: 19
Joined: Fri, 2014-03-14, 12:43

Re: Install external libraries (e.g. libtiff 3.9.4)

#4 Post by Oliver Neubauer »

Hi,

I´m able to build dcmtk with cmake and visual studio 2010 express (32 bit-compiler) now.

After the build of the "Install" subproject, I got the same final compiler output:

Code: Select all

========== Alles neu erstellen: 75 erfolgreich, Fehler bei 4, 0 übersprungen ==========
In the following is a more detailed snippet of the compiler output:

Code: Select all

55>  termscu.vcxproj -> C:\DCMTK\toBuild\dcmnet\apps\Debug\termscu.exe
56>------ Neues Erstellen gestartet: Projekt: tstchval, Konfiguration: Debug Win32 ------
54>MSVCRTD.lib(MSVCR100D.dll) : error LNK2005: _strncmp ist bereits in LIBCMTD.lib(strncmp.obj) definiert.
54>MSVCRTD.lib(MSVCR100D.dll) : error LNK2005: __wopen ist bereits in LIBCMTD.lib(wopen.obj) definiert.
54>MSVCRTD.lib(MSVCR100D.dll) : error LNK2005: _malloc ist bereits in LIBCMTD.lib(dbgmalloc.obj) definiert.
54>MSVCRTD.lib(MSVCR100D.dll) : error LNK2005: _free ist bereits in LIBCMTD.lib(dbgfree.obj) definiert.
54>MSVCRTD.lib(MSVCR100D.dll) : error LNK2005: _realloc ist bereits in LIBCMTD.lib(dbgrealloc.obj) definiert.
54>MSVCRTD.lib(MSVCR100D.dll) : error LNK2005: _vfprintf ist bereits in LIBCMTD.lib(vfprintf.obj) definiert.
54>MSVCRTD.lib(MSVCR100D.dll) : error LNK2005: _fprintf ist bereits in LIBCMTD.lib(fprintf.obj) definiert.
54>MSVCRTD.lib(MSVCR100D.dll) : error LNK2005: _sprintf ist bereits in LIBCMTD.lib(sprintf.obj) definiert.
54>MSVCRTD.lib(ti_inst.obj) : error LNK2005: "private: __thiscall type_info::type_info(class type_info const &)" (??0type_info@@AAE@ABV0@@Z) ist bereits in LIBCMTD.lib(typinfo.obj) definiert.
54>MSVCRTD.lib(ti_inst.obj) : error LNK2005: "private: class type_info & __thiscall type_info::operator=(class type_info const &)" (??4type_info@@AAEAAV0@ABV0@@Z) ist bereits in LIBCMTD.lib(typinfo.obj) definiert.
54>MSVCRTD.lib(MSVCR100D.dll) : error LNK2005: __read ist bereits in LIBCMTD.lib(read.obj) definiert.
54>MSVCRTD.lib(MSVCR100D.dll) : error LNK2005: __write ist bereits in LIBCMTD.lib(write.obj) definiert.
54>MSVCRTD.lib(MSVCR100D.dll) : error LNK2005: __lseek ist bereits in LIBCMTD.lib(lseek.obj) definiert.
54>MSVCRTD.lib(MSVCR100D.dll) : error LNK2005: __close ist bereits in LIBCMTD.lib(close.obj) definiert.
54>MSVCRTD.lib(MSVCR100D.dll) : error LNK2005: __fstat32 ist bereits in LIBCMTD.lib(fstat.obj) definiert.
54>MSVCRTD.lib(MSVCR100D.dll) : error LNK2005: __open ist bereits in LIBCMTD.lib(open.obj) definiert.
54>LINK : warning LNK4098: Standardbibliothek "MSVCRTD" steht in Konflikt mit anderen Bibliotheken; /NODEFAULTLIB:Bibliothek verwenden.
54>C:\DCMTK\toBuild\dcmjpls\apps\Debug\dcml2pnm.exe : fatal error LNK1169: Mindestens ein mehrfach definiertes Symbol gefunden.
57>MSVCRTD.lib(MSVCR100D.dll) : error LNK2005: _strncmp ist bereits in LIBCMTD.lib(strncmp.obj) definiert.
57>MSVCRTD.lib(MSVCR100D.dll) : error LNK2005: __wopen ist bereits in LIBCMTD.lib(wopen.obj) definiert.
57>MSVCRTD.lib(MSVCR100D.dll) : error LNK2005: _malloc ist bereits in LIBCMTD.lib(dbgmalloc.obj) definiert.
57>MSVCRTD.lib(MSVCR100D.dll) : error LNK2005: _free ist bereits in LIBCMTD.lib(dbgfree.obj) definiert.
57>MSVCRTD.lib(MSVCR100D.dll) : error LNK2005: _realloc ist bereits in LIBCMTD.lib(dbgrealloc.obj) definiert.
57>MSVCRTD.lib(MSVCR100D.dll) : error LNK2005: _vfprintf ist bereits in LIBCMTD.lib(vfprintf.obj) definiert.
57>MSVCRTD.lib(MSVCR100D.dll) : error LNK2005: _fprintf ist bereits in LIBCMTD.lib(fprintf.obj) definiert.
57>MSVCRTD.lib(MSVCR100D.dll) : error LNK2005: _sprintf ist bereits in LIBCMTD.lib(sprintf.obj) definiert.
57>MSVCRTD.lib(ti_inst.obj) : error LNK2005: "private: __thiscall type_info::type_info(class type_info const &)" (??0type_info@@AAE@ABV0@@Z) ist bereits in LIBCMTD.lib(typinfo.obj) definiert.
57>MSVCRTD.lib(ti_inst.obj) : error LNK2005: "private: class type_info & __thiscall type_info::operator=(class type_info const &)" (??4type_info@@AAEAAV0@ABV0@@Z) ist bereits in LIBCMTD.lib(typinfo.obj) definiert.
57>MSVCRTD.lib(MSVCR100D.dll) : error LNK2005: __read ist bereits in LIBCMTD.lib(read.obj) definiert.
57>MSVCRTD.lib(MSVCR100D.dll) : error LNK2005: __write ist bereits in LIBCMTD.lib(write.obj) definiert.
57>MSVCRTD.lib(MSVCR100D.dll) : error LNK2005: __lseek ist bereits in LIBCMTD.lib(lseek.obj) definiert.
57>MSVCRTD.lib(MSVCR100D.dll) : error LNK2005: __close ist bereits in LIBCMTD.lib(close.obj) definiert.
57>MSVCRTD.lib(MSVCR100D.dll) : error LNK2005: __fstat32 ist bereits in LIBCMTD.lib(fstat.obj) definiert.
57>MSVCRTD.lib(MSVCR100D.dll) : error LNK2005: __open ist bereits in LIBCMTD.lib(open.obj) definiert.
57>LINK : warning LNK4098: Standardbibliothek "MSVCRTD" steht in Konflikt mit anderen Bibliotheken; /NODEFAULTLIB:Bibliothek verwenden.
57>C:\DCMTK\toBuild\dcmjpeg\apps\Debug\dcmj2pnm.exe : fatal error LNK1169: Mindestens ein mehrfach definiertes Symbol gefunden.
74>MSVCRTD.lib(MSVCR100D.dll) : error LNK2005: _strncmp ist bereits in LIBCMTD.lib(strncmp.obj) definiert.
74>MSVCRTD.lib(MSVCR100D.dll) : error LNK2005: __wopen ist bereits in LIBCMTD.lib(wopen.obj) definiert.
74>MSVCRTD.lib(MSVCR100D.dll) : error LNK2005: _malloc ist bereits in LIBCMTD.lib(dbgmalloc.obj) definiert.
74>MSVCRTD.lib(MSVCR100D.dll) : error LNK2005: _free ist bereits in LIBCMTD.lib(dbgfree.obj) definiert.
74>MSVCRTD.lib(MSVCR100D.dll) : error LNK2005: _realloc ist bereits in LIBCMTD.lib(dbgrealloc.obj) definiert.
74>MSVCRTD.lib(MSVCR100D.dll) : error LNK2005: _vfprintf ist bereits in LIBCMTD.lib(vfprintf.obj) definiert.
74>MSVCRTD.lib(MSVCR100D.dll) : error LNK2005: _fprintf ist bereits in LIBCMTD.lib(fprintf.obj) definiert.
74>MSVCRTD.lib(MSVCR100D.dll) : error LNK2005: _sprintf ist bereits in LIBCMTD.lib(sprintf.obj) definiert.
74>MSVCRTD.lib(ti_inst.obj) : error LNK2005: "private: __thiscall type_info::type_info(class type_info const &)" (??0type_info@@AAE@ABV0@@Z) ist bereits in LIBCMTD.lib(typinfo.obj) definiert.
74>MSVCRTD.lib(ti_inst.obj) : error LNK2005: "private: class type_info & __thiscall type_info::operator=(class type_info const &)" (??4type_info@@AAEAAV0@ABV0@@Z) ist bereits in LIBCMTD.lib(typinfo.obj) definiert.
74>MSVCRTD.lib(MSVCR100D.dll) : error LNK2005: __read ist bereits in LIBCMTD.lib(read.obj) definiert.
74>MSVCRTD.lib(MSVCR100D.dll) : error LNK2005: __write ist bereits in LIBCMTD.lib(write.obj) definiert.
74>MSVCRTD.lib(MSVCR100D.dll) : error LNK2005: __lseek ist bereits in LIBCMTD.lib(lseek.obj) definiert.
74>MSVCRTD.lib(MSVCR100D.dll) : error LNK2005: __close ist bereits in LIBCMTD.lib(close.obj) definiert.
74>MSVCRTD.lib(MSVCR100D.dll) : error LNK2005: __fstat32 ist bereits in LIBCMTD.lib(fstat.obj) definiert.
74>MSVCRTD.lib(MSVCR100D.dll) : error LNK2005: __open ist bereits in LIBCMTD.lib(open.obj) definiert.
74>LINK : warning LNK4098: Standardbibliothek "MSVCRTD" steht in Konflikt mit anderen Bibliotheken; /NODEFAULTLIB:Bibliothek verwenden.
74>C:\DCMTK\toBuild\dcmimage\apps\Debug\dcm2pnm.exe : fatal error LNK1169: Mindestens ein mehrfach definiertes Symbol gefunden.
79>  CMake Error at dcmjpeg/apps/cmake_install.cmake:56 (FILE):
79>    file INSTALL cannot find
79>    "C:/DCMTK/toBuild/dcmjpeg/apps/Debug/dcmj2pnm.exe".
79>  Call Stack (most recent call first):
79>    dcmjpeg/cmake_install.cmake:36 (INCLUDE)
79>    cmake_install.cmake:52 (INCLUDE)
79>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(113,5): error MSB3073: Der Befehl "setlocal
79>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(113,5): error MSB3073: "C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -DBUILD_TYPE=Debug -P cmake_install.cmake
79>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(113,5): error MSB3073: if %errorlevel% neq 0 goto :cmEnd
79>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(113,5): error MSB3073: :cmEnd
79>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(113,5): error MSB3073: endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone
79>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(113,5): error MSB3073: :cmErrorLevel
79>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(113,5): error MSB3073: exit /b %1
79>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(113,5): error MSB3073: :cmDone
79>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(113,5): error MSB3073: if %errorlevel% neq 0 goto :VCEnd
79>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(113,5): error MSB3073: :VCEnd" wurde mit dem Code 1 beendet
Do you know, what does it mean? How can I solve the problem?

Thanks.

Regards,

Oliver

Jan Schlamelcher
OFFIS DICOM Team
OFFIS DICOM Team
Posts: 318
Joined: Mon, 2014-03-03, 09:51
Location: Oldenburg, Germany

Re: Install external libraries (e.g. libtiff 3.9.4)

#5 Post by Jan Schlamelcher »

To me this looks like a CMake-missconfiguration. Try deleting the CMake-cache and create a clean project for VS 10, if you didn't do that since this error occured:
Oliver Neubauer wrote:

Code: Select all

CMake Error at C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:61 (message):
  The C compiler "C:/Program Files (x86)/Microsoft Visual Studio
  10.0/VC/bin/cl.exe" is not able to compile a simple test program.

Oliver Neubauer
Posts: 19
Joined: Fri, 2014-03-14, 12:43

Re: Install external libraries (e.g. libtiff 3.9.4)

#6 Post by Oliver Neubauer »

Ok, I deleted the cmake-cache and built the dcmtk project including the tiff library according the INSTALL file. After that, I cleaned up and built the "INSTALL" subproject.

Unfortunately, I got the same compiler output mentioned above (75 projects created, 4 projects corrupt). I didn´t see any tiff related files in my install directory.

Are you familiar with this problem? Should I use the source code of the tiff library instead of the pre-compiled library?

Regards,

Oliver

Jan Schlamelcher
OFFIS DICOM Team
OFFIS DICOM Team
Posts: 318
Joined: Mon, 2014-03-03, 09:51
Location: Oldenburg, Germany

Re: Install external libraries (e.g. libtiff 3.9.4)

#7 Post by Jan Schlamelcher »

Oliver Neubauer wrote:Are you familiar with this problem?
MSVC is not really my preferred compiler ;-). Google shows that LNK2005 might refer to a /MT / /MD problem. Note that two different versions of the support libraries are provided. Perhaps you should try again with this version: ftp://dicom.offis.de/pub/dicom/offis/so ... ort_MD.zip
Oliver Neubauer wrote:Should I use the source code of the tiff library instead of the pre-compiled library?
This would possibly be worth a try, as this would also allow you to use the 64 bit compiler.

Oliver Neubauer
Posts: 19
Joined: Fri, 2014-03-14, 12:43

Re: Install external libraries (e.g. libtiff 3.9.4)

#8 Post by Oliver Neubauer »

Which compiler would you recommend? How did you build dcmtk including the external libraries? According theINSTALL file?

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

Re: Install external libraries (e.g. libtiff 3.9.4)

#9 Post by J. Riesmeier »

The LNK2005 issue is so famous that it has its own FAQ entry.

Also please note that the CMake files in DCMTK 3.6.0 do not correctly detect Win64 or VisualStudio versions after 2010... a more recent snapshot would solve these issues.

Jan Schlamelcher
OFFIS DICOM Team
OFFIS DICOM Team
Posts: 318
Joined: Mon, 2014-03-03, 09:51
Location: Oldenburg, Germany

Re: Install external libraries (e.g. libtiff 3.9.4)

#10 Post by Jan Schlamelcher »

Oliver Neubauer wrote:Which compiler would you recommend?
I personally use gcc derivates, e.g. mingw for windows. But that would also require you to build the tiff-library yourself. Another option is clang, but with the same restriction. I once tested building DCMTK with windows-clang and everything worked, but i couldn't create DLLs.
Note: I prefer gcc/clang since those compilers are closer to the C++-standard than MSVC, but MSVC is still the "default" compiler on the windows platform and therefore most people use it.
Oliver Neubauer wrote:How did you build dcmtk including the external libraries? According theINSTALL file?
As already said, using mingw / clang you have to build the tiff-library yourself and set the appropriate CMake-variables to point to the include files and libraries. If you never used mingw / clang, you should probably try to manually build the tiff library via MSVC first and see if this solves your problem (or see J. Riesmeier's post).

Oliver Neubauer
Posts: 19
Joined: Fri, 2014-03-14, 12:43

Re: Install external libraries (e.g. libtiff 3.9.4)

#11 Post by Oliver Neubauer »

ok, thanks for your helpful hints.

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

Re: Install external libraries (e.g. libtiff 3.9.4)

#12 Post by J. Riesmeier »

I just compiled DCMTK 3.6.0 with libtiff support (from the official ZIP package) and it works like expected. Here's the output of "dcm2pnm --version":

Code: Select all

$dcmtk: dcm2pnm v3.6.0 2011-01-06 $

dcm2pnm: Convert DICOM images to PGM/PPM, TIFF or BMP

Host type: AMD64-Windows

External libraries used:
- LIBTIFF, Version 3.9.4
  with LZW compression support
Btw, I used VisualStudio 2010 Express (32-bit) on a Windows 7 (64-bit) system.

Oliver Neubauer
Posts: 19
Joined: Fri, 2014-03-14, 12:43

Re: Install external libraries (e.g. libtiff 3.9.4)

#13 Post by Oliver Neubauer »

Hi,

I´m able to build the dcmtk including the TIFF library.

For other user:

Replace all occurrence from "MT" by "MD" and "MTd" by "MDd" (see FAQ #26). I compiled dcmtk with Visual Studio 2010 Express (32 bit) on Windows 7 (64 bit).

Best regards,

Oliver


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

Re: Install external libraries (e.g. libtiff 3.9.4)

#15 Post by J. Riesmeier »

The default CMake settings of the DCMTK source code package are MT/MTd, i.e. you have either changed this default or your compiler is not detected by DCMTK's CMake settings (which is e.g. true for Win64 when using the latest DCMTK release 3.6.0 - see above).

Btw, you do not need to change the CMake file(s) in order to use MD/MDd code generation settings: Just disable the DCMTK_OVERWRITE_WIN32_COMPILER_FLAGS option.

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 1 guest