error LNK2005: xxx already defined in MSVCRT.lib(MSVCR100.dll) C:\something\LIBCMT.lib(setlocal.obj)

后端 未结 4 1791
终归单人心
终归单人心 2020-11-29 18:12

I\'m using DCMTK library for reading Dicom files (Image format used in medical image processing.) I\'m having a problem in compiling this DCMTK source code. DCMTK uses some

4条回答
  •  鱼传尺愫
    2020-11-29 18:46

    You are mixing code that was compiled with /MD (use DLL version of CRT) with code that was compiled with /MT (use static CRT library). That cannot work, all source code files must be compiled with the same setting. Given that you use libraries that were pre-compiled with /MD, almost always the correct setting, you must compile your own code with this setting as well.

    Project + Properties, C/C++, Code Generation, Runtime Library.

    Beware that these libraries were probably compiled with an earlier version of the CRT, msvcr100.dll is quite new. Not sure if that will cause trouble, you may have to prevent the linker from generating a manifest. You must also make sure to deploy the DLLs you need to the target machine, including msvcr100.dll

提交回复
热议问题