[Insight-developers] Problems with Visual Studio 2010 linkage -- any experts?

Williams, Norman K norman-k-williams at uiowa.edu
Fri Nov 2 14:45:38 EDT 2012


I'm trying not to hate Visual Studio.  I'm hoping someone here can help me
not to.

I'm building DCMTK and then using USE_SYSTEM_DCMTK to build ITK with the
new DCMTKIO.  Through the generous help of Brad King, it works on Windows
now - mostly.  The problem is that there's a library collision between the
DCMTK and ITK libraries when I try to link the ITK tests.

I've tried Googling for solutions and the consensus of the Internet
suggests no solutions and says basically "yes this happens and yes it's
annoying."

I can understand how I might make this happen -- use different library
models for DCMTK and ITK.  But I've looked at the CMakeCache.txt for both
projects and all the
compiler and linker flags are identical.

Anyone run into this and know how to make it work?

Here's a representative excerpt of the output:
605>msvcprtd.lib(MSVCP100D.dll) : error LNK2005: "public: class
std::basic_ostream<char,struct std::char_traits<char> > & __thiscall
std::basic_ostream<char,struct std::char_traits<char> >::put(char)"
(?put@?$basic_ostream at DU?$char_traits at D@std@@@std@@QAEAAV12 at D@Z) already
defined in oflog.lib(oflog.obj)

605>MSVCRTD.lib(MSVCR100D.dll) : error LNK2005: __strdup already defined
in LIBCMTD.lib(strdup.obj)

605>MSVCRTD.lib(MSVCR100D.dll) : error LNK2005: __unlink already defined
in LIBCMTD.lib(unlink.obj)

605>MSVCRTD.lib(MSVCR100D.dll) : error LNK2005: _strtol already defined in
LIBCMTD.lib(strtol.obj)

605>MSVCRTD.lib(MSVCR100D.dll) : error LNK2005: __fileno already defined
in LIBCMTD.lib(fileno.obj)

605>MSVCRTD.lib(MSVCR100D.dll) : error LNK2005: _vsprintf already defined
in LIBCMTD.lib(vsprintf.obj)

605>MSVCRTD.lib(MSVCR100D.dll) : error LNK2005: __get_osfhandle already
defined in LIBCMTD.lib(osfinfo.obj)

605>MSVCRTD.lib(MSVCR100D.dll) : error LNK2005: __write already defined in
LIBCMTD.lib(write.obj)

605>MSVCRTD.lib(MSVCR100D.dll) : error LNK2005: __lseeki64 already defined
in LIBCMTD.lib(lseeki64.obj)

605>MSVCRTD.lib(MSVCR100D.dll) : error LNK2005: __aligned_malloc already
defined in LIBCMTD.lib(dbgheap.obj)

605>MSVCRTD.lib(MSVCR100D.dll) : error LNK2005: __aligned_free already
defined in LIBCMTD.lib(dbgheap.obj)

605>     Creating library
C:/itktest/ITK-build/lib/Debug/BilateralImageFilter.lib and object
C:/itktest/ITK-build/lib/Debug/BilateralImageFilter.exp

605>LINK : warning LNK4098: defaultlib 'MSVCRTD' conflicts with use of
other libs; use /NODEFAULTLIB:library

605>LINK : warning LNK4098: defaultlib 'LIBCMTD' conflicts with use of
other libs; use /NODEFAULTLIB:library

605>C:\itktest\ITK-build\bin\Debug\BilateralImageFilter.exe : fatal error
LNK1169: one or more multiply defined symbols found

605>




Where it's falling down is that apparentl





________________________________
Notice: This UI Health Care e-mail (including attachments) is covered by the Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is confidential and may be legally privileged.  If you are not the intended recipient, you are hereby notified that any retention, dissemination, distribution, or copying of this communication is strictly prohibited.  Please reply to the sender that you have received the message in error, then delete it.  Thank you.
________________________________


More information about the Insight-developers mailing list