DICOM @ OFFIS

Discussion Forum for OFFIS DICOM Tools - For registration, send email with desired user name to the OFFIS DICOM team
It is currently Tue, 2018-01-16, 22:13

All times are UTC + 1 hour




Post new topic Reply to topic  [ 10 posts ] 
Author Message
PostPosted: Mon, 2013-04-29, 00:22 
Offline

Joined: Mon, 2007-08-27, 10:37
Posts: 22
Hello,

I am trying to use decoder of dcmtk and i got several errors of redefinitions. I tried to compile dcmtk and always i got 5 parts of the dcmtk that could not be build successfully. These parts are fundamental for registering the decoder. When I build it with Cxx flags \MT instead of \MD everything went right and everything worked. But using dcmtk within qt i got again errors:

msvcrtd.lib(ti_inst.obj):-1: error: LNK2005: "private: __thiscall type_info::type_info(class type_info const &)" (??0type_info@@AAE@ABV0@@Z) already defined in LIBCMTD.lib(typinfo.obj)
msvcrtd.lib(ti_inst.obj):-1: error: LNK2005: "private: class type_info & __thiscall type_info::operator=(class type_info const &)" (??4type_info@@AAEAAV0@ABV0@@Z) already defined in LIBCMTD.lib(typinfo.obj)
...

So what's wrong? Within my projects in MSVC i get no errors. With qt i also tried to build in \MT and the mentioned errors occured.

pls help


Top
 Profile  
 
PostPosted: Mon, 2013-04-29, 08:54 
Offline
DCMTK Developer

Joined: Tue, 2011-05-03, 14:38
Posts: 1889
Location: Oldenburg, Germany
Did you recompile the whole project (including all DCMTK modules and external libraries) with the same code generation settings?

Also see FAQ #26.


Top
 Profile  
 
PostPosted: Mon, 2013-04-29, 11:42 
Offline

Joined: Mon, 2007-08-27, 10:37
Posts: 22
Yes I did. I changed everything to \MT and \MTd and it does only compile successful for \MD and \MDd.


Top
 Profile  
 
PostPosted: Mon, 2013-04-29, 19:04 
Offline
DCMTK Developer

Joined: Tue, 2011-05-03, 14:38
Posts: 1889
Location: Oldenburg, Germany
But DCMTK compiles and links correctly, i.e. including all command line tools?


Top
 Profile  
 
PostPosted: Wed, 2013-05-01, 01:04 
Offline

Joined: Mon, 2007-08-27, 10:37
Posts: 22
No, 5 of the DCMTK Library does not compile correctly. By using

Code:
DJEncoderRegistration::registerCodecs(); // register JPEG codecs


in my project I got errors.


Top
 Profile  
 
PostPosted: Wed, 2013-05-01, 09:37 
Offline
DCMTK Developer

Joined: Tue, 2011-05-03, 14:38
Posts: 1889
Location: Oldenburg, Germany
My question was whether the DCMTK compiles and links correctly with the used code generation settings (not your project).


Top
 Profile  
 
PostPosted: Wed, 2013-05-01, 13:00 
Offline

Joined: Mon, 2007-08-27, 10:37
Posts: 22
OK sry. By compiling DCMTK with \MD I get:

Code:
1>------ Build started: Project: ZERO_CHECK, Configuration: Release Win32 ------
2>------ Skipped Build: Project: RUN_TESTS, Configuration: Release Win32 ------
2>Project not selected to build for this solution configuration
1>Build started 01.05.2013 13:58:06.
1>InitializeBuildStatus:
1>  Creating "Win32\Release\ZERO_CHECK\ZERO_CHECK.unsuccessfulbuild" because "AlwaysCreate" was specified.
1>FinalizeBuildStatus:
1>  Deleting file "Win32\Release\ZERO_CHECK\ZERO_CHECK.unsuccessfulbuild".
1>  Touching "Win32\Release\ZERO_CHECK\ZERO_CHECK.lastbuildstate".
1>
1>Build succeeded.
1>
1>Time Elapsed 00:00:01.19
3>------ Build started: Project: dcmsend, Configuration: Release Win32 ------
3>Build started 01.05.2013 13:58:17.
3>InitializeBuildStatus:
3>  Touching "dcmsend.dir\Release\dcmsend.unsuccessfulbuild".
3>CustomBuild:
3>  All outputs are up-to-date.
3>ClCompile:
3>  All outputs are up-to-date.
4>------ Build started: Project: dcmmkdir, Configuration: Release Win32 ------
4>Build started 01.05.2013 13:58:21.
4>InitializeBuildStatus:
4>  Touching "dcmmkdir.dir\Release\dcmmkdir.unsuccessfulbuild".
4>CustomBuild:
4>  All outputs are up-to-date.
4>ClCompile:
4>  All outputs are up-to-date.
3>LIBCMT.lib(invarg.obj) : error LNK2005: __invoke_watson already defined in MSVCRT.lib(MSVCR100.dll)
3>     Creating library F:/Bibliotheken/dcmtk/build/lib/Release/dcmsend.lib and object F:/Bibliotheken/dcmtk/build/lib/Release/dcmsend.exp
3>LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library
3>F:\Bibliotheken\dcmtk\build\bin\Release\dcmsend.exe : fatal error LNK1169: one or more multiply defined symbols found
3>
3>Build FAILED.
3>
3>Time Elapsed 00:00:04.65
5>------ Build started: Project: dcmj2pnm, Configuration: Release Win32 ------
5>Build started 01.05.2013 13:58:22.
5>InitializeBuildStatus:
5>  Touching "dcmj2pnm.dir\Release\dcmj2pnm.unsuccessfulbuild".
5>CustomBuild:
5>  All outputs are up-to-date.
5>ClCompile:
4>LIBCMT.lib(invarg.obj) : error LNK2005: __invoke_watson already defined in MSVCRT.lib(MSVCR100.dll)
4>     Creating library F:/Bibliotheken/dcmtk/build/lib/Release/dcmmkdir.lib and object F:/Bibliotheken/dcmtk/build/lib/Release/dcmmkdir.exp
4>LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library
4>F:\Bibliotheken\dcmtk\build\bin\Release\dcmmkdir.exe : fatal error LNK1169: one or more multiply defined symbols found
4>
4>Build FAILED.
4>
4>Time Elapsed 00:00:01.91
6>------ Build started: Project: dcmdjpeg, Configuration: Release Win32 ------
5>  All outputs are up-to-date.
5>LIBCMT.lib(invarg.obj) : error LNK2005: __invoke_watson already defined in MSVCRT.lib(MSVCR100.dll)
5>     Creating library F:/Bibliotheken/dcmtk/build/lib/Release/dcmj2pnm.lib and object F:/Bibliotheken/dcmtk/build/lib/Release/dcmj2pnm.exp
5>LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library
5>F:\Bibliotheken\dcmtk\build\bin\Release\dcmj2pnm.exe : fatal error LNK1169: one or more multiply defined symbols found
5>
6>Build started 01.05.2013 13:58:24.
5>Build FAILED.
5>
5>Time Elapsed 00:00:01.15
6>InitializeBuildStatus:
6>  Touching "dcmdjpeg.dir\Release\dcmdjpeg.unsuccessfulbuild".
6>CustomBuild:
6>  All outputs are up-to-date.
6>ClCompile:
6>  All outputs are up-to-date.
7>------ Build started: Project: dcmcjpeg, Configuration: Release Win32 ------
7>Build started 01.05.2013 13:58:25.
6>LIBCMT.lib(invarg.obj) : error LNK2005: __invoke_watson already defined in MSVCRT.lib(MSVCR100.dll)
6>     Creating library F:/Bibliotheken/dcmtk/build/lib/Release/dcmdjpeg.lib and object F:/Bibliotheken/dcmtk/build/lib/Release/dcmdjpeg.exp
6>LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library
6>F:\Bibliotheken\dcmtk\build\bin\Release\dcmdjpeg.exe : fatal error LNK1169: one or more multiply defined symbols found
6>
6>Build FAILED.
6>
6>Time Elapsed 00:00:01.14
7>InitializeBuildStatus:
7>  Touching "dcmcjpeg.dir\Release\dcmcjpeg.unsuccessfulbuild".
7>CustomBuild:
7>  All outputs are up-to-date.
7>ClCompile:
7>  All outputs are up-to-date.
7>LIBCMT.lib(invarg.obj) : error LNK2005: __invoke_watson already defined in MSVCRT.lib(MSVCR100.dll)
7>     Creating library F:/Bibliotheken/dcmtk/build/lib/Release/dcmcjpeg.lib and object F:/Bibliotheken/dcmtk/build/lib/Release/dcmcjpeg.exp
7>LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library
7>F:\Bibliotheken\dcmtk\build\bin\Release\dcmcjpeg.exe : fatal error LNK1169: one or more multiply defined symbols found
7>
7>Build FAILED.
7>
7>Time Elapsed 00:00:01.03
8>------ Build started: Project: ALL_BUILD, Configuration: Release Win32 ------
8>Build started 01.05.2013 13:58:26.
8>InitializeBuildStatus:
8>  Creating "Win32\Release\ALL_BUILD\ALL_BUILD.unsuccessfulbuild" because "AlwaysCreate" was specified.
8>CustomBuild:
8>  Build all projects
8>FinalizeBuildStatus:
8>  Deleting file "Win32\Release\ALL_BUILD\ALL_BUILD.unsuccessfulbuild".
8>  Touching "Win32\Release\ALL_BUILD\ALL_BUILD.lastbuildstate".
8>
8>Build succeeded.
8>
8>Time Elapsed 00:00:01.48
9>------ Skipped Build: Project: INSTALL, Configuration: Release Win32 ------
9>Project not selected to build for this solution configuration
========== Build: 2 succeeded, 5 failed, 76 up-to-date, 2 skipped ==========


Top
 Profile  
 
PostPosted: Thu, 2013-05-02, 21:13 
Offline

Joined: Wed, 2010-05-19, 09:27
Posts: 56
Location: Oldenburg, Germany
Have you ever modified the flags "/MTd" and "/MT" in both CMakeLists.txt and CMake GUI ? As I know, CMake will not change the changes if you only modify them in CMake GUI.

The other possible problem is "zlib" because I found the some modules (dcmj2pnm, dcmmkdir, dcmj2pnm, dcmdjpeg) occurring this error are including zlib. Please check the zlib's configure.


Top
 Profile  
 
PostPosted: Fri, 2013-05-03, 08:04 
Offline

Joined: Mon, 2007-08-27, 10:37
Posts: 22
@Chung-Yueh Lien:

This doesn't change anything. I still get errors. My ZLIB ist also compile with the same flags. It's strange, that these errors only occur with MDd and MD but not with MTd and MT. Are there any other libraries which are mandatory for dcmj2pnm, dcmmkdir, dcmj2pnm and dcmdjpeg ?


Top
 Profile  
 
PostPosted: Fri, 2013-05-03, 18:03 
Offline

Joined: Wed, 2010-05-19, 09:27
Posts: 56
Location: Oldenburg, Germany
I tried to reproduce your problem in my PC, it may be caused by the incorrect supported libraries with inconsistent runtime configuration, that you specified the supported libraries with "Multithreaded" runtime options (/MT and /MTd) configuration, however the configuration of dcmtk is specified as "Multithreaded" runtime options (/MD and /MDd).

If you specify the runtime option of dcmtk as MDd and MD, consequently the supported libraries should be dcmtk-3.6.0-win32-i386-support_MD.zip, vice versa.

That is the reason why other projects were built successfully because they don't link to supported libraries.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 

All times are UTC + 1 hour


Who is online

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


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group