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

Bill Hoffman bill.hoffman at kitware.com
Fri Nov 2 15:04:10 EDT 2012


http://forum.dcmtk.org/viewtopic.php?t=35
http://msdn.microsoft.com/en-us/library/abx4dbyh%28v=vs.80%29.aspx


LIBCPMTD is the static run time library for MS VS.

MSVCRTD is the dynamic dll run time library for MS VS.

Debug Multithreaded (/MTd)	LIBCMTD.LIB / LIBCPMTD.LIB
Debug Multithreaded /DLL (MDd)	MSVCRTD.LIB / MSVCPRTD.LIB


What CMake generator are you using?

-Bill


On 11/2/2012 2:45 PM, Williams, Norman K wrote:
> 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.
> ________________________________
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://kitware.com/products/protraining.php
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-developers
>


-- 
Bill Hoffman
Kitware, Inc.
28 Corporate Drive
Clifton Park, NY 12065
bill.hoffman at kitware.com
http://www.kitware.com
518 881-4905 (Direct)
518 371-3971 x105
Fax (518) 371-4573


More information about the Insight-developers mailing list