error LNK2005: xxx ya definido en MSVCRT.lib (MSVCR100.dll) C: \ algo \ LIBCMT.lib (setlocal.obj)


76

Estoy usando la biblioteca DCMTK para leer archivos Dicom (formato de imagen utilizado en el procesamiento de imágenes médicas). Tengo un problema al compilar este código fuente DCMTK. DCMTK utiliza algunas bibliotecas externas adicionales (zlib, tiff, libpng, libxml2, libiconv). Sé que todas las bibliotecas deben generarse con las mismas opciones de generación de código.

He descargado las versiones compiladas de estas bibliotecas de soporte que se compilan con las opciones de tiempo de ejecución de "DLL multiproceso" (/ MD). En cada proyecto de código fuente de DCMTK, me aseguré de que las opciones de tiempo de ejecución fueran "DLL multiproceso" (/ MD). Pero sigo recibiendo estos errores:

Error   238 error LNK2005: ___iob_func already defined in MSVCRT.lib(MSVCR100.dll)  C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\LIBCMT.lib(_file.obj)    dcmp2pgm
Error   239 error LNK2005: __lock_file already defined in MSVCRT.lib(MSVCR100.dll)  C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\LIBCMT.lib(_file.obj)    dcmp2pgm
Error   240 error LNK2005: __unlock_file already defined in MSVCRT.lib(MSVCR100.dll)    C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\LIBCMT.lib(_file.obj)    dcmp2pgm
Error   241 error LNK2005: __initterm_e already defined in MSVCRT.lib(MSVCR100.dll) C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\LIBCMT.lib(crt0dat.obj)  dcmp2pgm
Error   242 error LNK2005: _exit already defined in MSVCRT.lib(MSVCR100.dll)    C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\LIBCMT.lib(crt0dat.obj)  dcmp2pgm
Error   243 error LNK2005: __exit already defined in MSVCRT.lib(MSVCR100.dll)   C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\LIBCMT.lib(crt0dat.obj)  dcmp2pgm
Error   244 error LNK2005: __cexit already defined in MSVCRT.lib(MSVCR100.dll)  C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\LIBCMT.lib(crt0dat.obj)  dcmp2pgm
Error   245 error LNK2005: __amsg_exit already defined in MSVCRT.lib(MSVCR100.dll)  C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\LIBCMT.lib(crt0dat.obj)  dcmp2pgm
Error   246 error LNK2005: _fflush already defined in MSVCRT.lib(MSVCR100.dll)  C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\LIBCMT.lib(fflush.obj)   dcmp2pgm
Error   247 error LNK2005: __errno already defined in MSVCRT.lib(MSVCR100.dll)  C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\LIBCMT.lib(dosmap.obj)   dcmp2pgm
Error   248 error LNK2005: __invoke_watson already defined in MSVCRT.lib(MSVCR100.dll)  C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\LIBCMT.lib(invarg.obj)   dcmp2pgm
Error   249 error LNK2005: "void __cdecl terminate(void)" (?terminate@@YAXXZ) already defined in MSVCRT.lib(MSVCR100.dll)   C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\LIBCMT.lib(hooks.obj)    dcmp2pgm
Error   250 error LNK2005: ___xi_a already defined in MSVCRT.lib(cinitexe.obj)  C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\LIBCMT.lib(crt0init.obj) dcmp2pgm
Error   251 error LNK2005: ___xi_z already defined in MSVCRT.lib(cinitexe.obj)  C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\LIBCMT.lib(crt0init.obj) dcmp2pgm
Error   252 error LNK2005: ___xc_a already defined in MSVCRT.lib(cinitexe.obj)  C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\LIBCMT.lib(crt0init.obj) dcmp2pgm
Error   253 error LNK2005: ___xc_z already defined in MSVCRT.lib(cinitexe.obj)  C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\LIBCMT.lib(crt0init.obj) dcmp2pgm
Error   254 error LNK2005: __unlock already defined in MSVCRT.lib(MSVCR100.dll) C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\LIBCMT.lib(mlock.obj)    dcmp2pgm
Error   255 error LNK2005: __lock already defined in MSVCRT.lib(MSVCR100.dll)   C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\LIBCMT.lib(mlock.obj)    dcmp2pgm
Error   256 error LNK2005: __XcptFilter already defined in MSVCRT.lib(MSVCR100.dll) C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\LIBCMT.lib(winxfltr.obj) dcmp2pgm
Error   257 error LNK2005: _mainCRTStartup already defined in MSVCRT.lib(crtexe.obj)    C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\LIBCMT.lib(crt0.obj) dcmp2pgm
Error   258 error LNK2005: ___set_app_type already defined in MSVCRT.lib(MSVCR100.dll)  C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\LIBCMT.lib(errmode.obj)  dcmp2pgm
Error   259 error LNK2005: __configthreadlocale already defined in MSVCRT.lib(MSVCR100.dll) C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\LIBCMT.lib(setlocal.obj) dcmp2pgm
Error   260 error LNK2005: _getenv already defined in MSVCRT.lib(MSVCR100.dll)  C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\LIBCMT.lib(getenv.obj)   dcmp2pgm
Error   261 error LNK2005: __isctype already defined in MSVCRT.lib(MSVCR100.dll)    C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\LIBCMT.lib(isctype.obj)  dcmp2pgm
Error   262 error LNK2005: __strnicmp already defined in MSVCRT.lib(MSVCR100.dll)   C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\LIBCMT.lib(strnicmp.obj) dcmp2pgm
Error   263 error LNK2005: __close already defined in LIBCMT.lib(close.obj) C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\MSVCRT.lib(MSVCR100.dll) dcmp2pgm
Error   264 error LNK2005: __fileno already defined in LIBCMT.lib(fileno.obj)   C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\MSVCRT.lib(MSVCR100.dll) dcmp2pgm
Error   265 error LNK2005: _calloc already defined in LIBCMT.lib(calloc.obj)    C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\MSVCRT.lib(MSVCR100.dll) dcmp2pgm
Error   266 error LNK2005: _atol already defined in LIBCMT.lib(atox.obj)    C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\MSVCRT.lib(MSVCR100.dll) dcmp2pgm
Error   267 error LNK2005: _strcspn already defined in LIBCMT.lib(strcspn.obj)  C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\MSVCRT.lib(MSVCR100.dll) dcmp2pgm
Error   268 error LNK2005: __stricmp already defined in LIBCMT.lib(stricmp.obj) C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\MSVCRT.lib(MSVCR100.dll) dcmp2pgm
Error   269 error LNK2005: _atoi already defined in LIBCMT.lib(atox.obj)    C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\MSVCRT.lib(MSVCR100.dll) dcmp2pgm
Error   270 error LNK2005: __lseek already defined in LIBCMT.lib(lseek.obj) C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\MSVCRT.lib(MSVCR100.dll) dcmp2pgm
Error   271 error LNK2005: __read already defined in LIBCMT.lib(read.obj)   C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\MSVCRT.lib(MSVCR100.dll) dcmp2pgm
Error   272 error LNK2005: __write already defined in LIBCMT.lib(write.obj) C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\MSVCRT.lib(MSVCR100.dll) dcmp2pgm
Error   273 error LNK2005: __open already defined in LIBCMT.lib(open.obj)   C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\MSVCRT.lib(MSVCR100.dll) dcmp2pgm
Error   274 error LNK2005: __get_osfhandle already defined in LIBCMT.lib(osfinfo.obj)   C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\MSVCRT.lib(MSVCR100.dll) dcmp2pgm
Error   278 error LNK1169: one or more multiply defined symbols found   C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\Release\dcmp2pgm.exe 1   1   dcmp2pgm
Error   201 error LNK2005: ___iob_func already defined in MSVCRT.lib(MSVCR100.dll)  C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\LIBCMT.lib(_file.obj)    dcmprscp
Error   202 error LNK2005: __lock_file already defined in MSVCRT.lib(MSVCR100.dll)  C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\LIBCMT.lib(_file.obj)    dcmprscp
Error   203 error LNK2005: __unlock_file already defined in MSVCRT.lib(MSVCR100.dll)    C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\LIBCMT.lib(_file.obj)    dcmprscp
Error   204 error LNK2005: __initterm_e already defined in MSVCRT.lib(MSVCR100.dll) C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\LIBCMT.lib(crt0dat.obj)  dcmprscp
Error   205 error LNK2005: _exit already defined in MSVCRT.lib(MSVCR100.dll)    C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\LIBCMT.lib(crt0dat.obj)  dcmprscp
Error   206 error LNK2005: __exit already defined in MSVCRT.lib(MSVCR100.dll)   C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\LIBCMT.lib(crt0dat.obj)  dcmprscp
Error   207 error LNK2005: __cexit already defined in MSVCRT.lib(MSVCR100.dll)  C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\LIBCMT.lib(crt0dat.obj)  dcmprscp
Error   208 error LNK2005: __amsg_exit already defined in MSVCRT.lib(MSVCR100.dll)  C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\LIBCMT.lib(crt0dat.obj)  dcmprscp
Error   209 error LNK2005: _fflush already defined in MSVCRT.lib(MSVCR100.dll)  C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\LIBCMT.lib(fflush.obj)   dcmprscp
Error   210 error LNK2005: __errno already defined in MSVCRT.lib(MSVCR100.dll)  C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\LIBCMT.lib(dosmap.obj)   dcmprscp
Error   211 error LNK2005: __invoke_watson already defined in MSVCRT.lib(MSVCR100.dll)  C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\LIBCMT.lib(invarg.obj)   dcmprscp
Error   212 error LNK2005: "void __cdecl terminate(void)" (?terminate@@YAXXZ) already defined in MSVCRT.lib(MSVCR100.dll)   C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\LIBCMT.lib(hooks.obj)    dcmprscp
Error   213 error LNK2005: ___xi_a already defined in MSVCRT.lib(cinitexe.obj)  C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\LIBCMT.lib(crt0init.obj) dcmprscp
Error   214 error LNK2005: ___xi_z already defined in MSVCRT.lib(cinitexe.obj)  C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\LIBCMT.lib(crt0init.obj) dcmprscp
Error   215 error LNK2005: ___xc_a already defined in MSVCRT.lib(cinitexe.obj)  C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\LIBCMT.lib(crt0init.obj) dcmprscp
Error   216 error LNK2005: ___xc_z already defined in MSVCRT.lib(cinitexe.obj)  C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\LIBCMT.lib(crt0init.obj) dcmprscp
Error   217 error LNK2005: __unlock already defined in MSVCRT.lib(MSVCR100.dll) C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\LIBCMT.lib(mlock.obj)    dcmprscp
Error   218 error LNK2005: __lock already defined in MSVCRT.lib(MSVCR100.dll)   C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\LIBCMT.lib(mlock.obj)    dcmprscp
Error   219 error LNK2005: __XcptFilter already defined in MSVCRT.lib(MSVCR100.dll) C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\LIBCMT.lib(winxfltr.obj) dcmprscp
Error   220 error LNK2005: __stricmp already defined in MSVCRT.lib(MSVCR100.dll)    C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\LIBCMT.lib(stricmp.obj)  dcmprscp
Error   221 error LNK2005: _mainCRTStartup already defined in MSVCRT.lib(crtexe.obj)    C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\LIBCMT.lib(crt0.obj) dcmprscp
Error   222 error LNK2005: ___set_app_type already defined in MSVCRT.lib(MSVCR100.dll)  C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\LIBCMT.lib(errmode.obj)  dcmprscp
Error   223 error LNK2005: __configthreadlocale already defined in MSVCRT.lib(MSVCR100.dll) C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\LIBCMT.lib(setlocal.obj) dcmprscp
Error   224 error LNK2005: _getenv already defined in MSVCRT.lib(MSVCR100.dll)  C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\LIBCMT.lib(getenv.obj)   dcmprscp
Error   225 error LNK2005: __isctype already defined in MSVCRT.lib(MSVCR100.dll)    C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\LIBCMT.lib(isctype.obj)  dcmprscp
Error   226 error LNK2005: __strnicmp already defined in MSVCRT.lib(MSVCR100.dll)   C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\LIBCMT.lib(strnicmp.obj) dcmprscp
Error   227 error LNK2005: __close already defined in LIBCMT.lib(close.obj) C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\MSVCRT.lib(MSVCR100.dll) dcmprscp
Error   228 error LNK2005: __fileno already defined in LIBCMT.lib(fileno.obj)   C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\MSVCRT.lib(MSVCR100.dll) dcmprscp
Error   229 error LNK2005: __lseek already defined in LIBCMT.lib(lseek.obj) C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\MSVCRT.lib(MSVCR100.dll) dcmprscp
Error   230 error LNK2005: __read already defined in LIBCMT.lib(read.obj)   C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\MSVCRT.lib(MSVCR100.dll) dcmprscp
Error   231 error LNK2005: __write already defined in LIBCMT.lib(write.obj) C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\MSVCRT.lib(MSVCR100.dll) dcmprscp
Error   232 error LNK2005: __open already defined in LIBCMT.lib(open.obj)   C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\MSVCRT.lib(MSVCR100.dll) dcmprscp
Error   233 error LNK2005: __get_osfhandle already defined in LIBCMT.lib(osfinfo.obj)   C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\MSVCRT.lib(MSVCR100.dll) dcmprscp
Error   237 error LNK1169: one or more multiply defined symbols found   C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\Release\dcmprscp.exe 1   1   dcmprscp
Error   160 error LNK2005: ___iob_func already defined in MSVCRT.lib(MSVCR100.dll)  C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\LIBCMT.lib(_file.obj)    dcmprscu
Error   161 error LNK2005: __lock_file already defined in MSVCRT.lib(MSVCR100.dll)  C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\LIBCMT.lib(_file.obj)    dcmprscu
Error   162 error LNK2005: __unlock_file already defined in MSVCRT.lib(MSVCR100.dll)    C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\LIBCMT.lib(_file.obj)    dcmprscu
Error   163 error LNK2005: __initterm_e already defined in MSVCRT.lib(MSVCR100.dll) C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\LIBCMT.lib(crt0dat.obj)  dcmprscu
Error   164 error LNK2005: _exit already defined in MSVCRT.lib(MSVCR100.dll)    C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\LIBCMT.lib(crt0dat.obj)  dcmprscu
Error   165 error LNK2005: __exit already defined in MSVCRT.lib(MSVCR100.dll)   C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\LIBCMT.lib(crt0dat.obj)  dcmprscu
Error   166 error LNK2005: __cexit already defined in MSVCRT.lib(MSVCR100.dll)  C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\LIBCMT.lib(crt0dat.obj)  dcmprscu
Error   167 error LNK2005: __amsg_exit already defined in MSVCRT.lib(MSVCR100.dll)  C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\LIBCMT.lib(crt0dat.obj)  dcmprscu
Error   168 error LNK2005: _fflush already defined in MSVCRT.lib(MSVCR100.dll)  C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\LIBCMT.lib(fflush.obj)   dcmprscu
Error   169 error LNK2005: __errno already defined in MSVCRT.lib(MSVCR100.dll)  C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\LIBCMT.lib(dosmap.obj)   dcmprscu
Error   170 error LNK2005: __invoke_watson already defined in MSVCRT.lib(MSVCR100.dll)  C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\LIBCMT.lib(invarg.obj)   dcmprscu
Error   171 error LNK2005: "void __cdecl terminate(void)" (?terminate@@YAXXZ) already defined in MSVCRT.lib(MSVCR100.dll)   C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\LIBCMT.lib(hooks.obj)    dcmprscu
Error   172 error LNK2005: ___xi_a already defined in MSVCRT.lib(cinitexe.obj)  C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\LIBCMT.lib(crt0init.obj) dcmprscu
Error   173 error LNK2005: ___xi_z already defined in MSVCRT.lib(cinitexe.obj)  C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\LIBCMT.lib(crt0init.obj) dcmprscu
Error   174 error LNK2005: ___xc_a already defined in MSVCRT.lib(cinitexe.obj)  C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\LIBCMT.lib(crt0init.obj) dcmprscu
Error   175 error LNK2005: ___xc_z already defined in MSVCRT.lib(cinitexe.obj)  C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\LIBCMT.lib(crt0init.obj) dcmprscu
Error   176 error LNK2005: __unlock already defined in MSVCRT.lib(MSVCR100.dll) C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\LIBCMT.lib(mlock.obj)    dcmprscu
Error   177 error LNK2005: __lock already defined in MSVCRT.lib(MSVCR100.dll)   C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\LIBCMT.lib(mlock.obj)    dcmprscu
Error   178 error LNK2005: __XcptFilter already defined in MSVCRT.lib(MSVCR100.dll) C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\LIBCMT.lib(winxfltr.obj) dcmprscu
Error   179 error LNK2005: _mainCRTStartup already defined in MSVCRT.lib(crtexe.obj)    C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\LIBCMT.lib(crt0.obj) dcmprscu
Error   180 error LNK2005: ___set_app_type already defined in MSVCRT.lib(MSVCR100.dll)  C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\LIBCMT.lib(errmode.obj)  dcmprscu
Error   181 error LNK2005: __configthreadlocale already defined in MSVCRT.lib(MSVCR100.dll) C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\LIBCMT.lib(setlocal.obj) dcmprscu
Error   182 error LNK2005: _getenv already defined in MSVCRT.lib(MSVCR100.dll)  C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\LIBCMT.lib(getenv.obj)   dcmprscu
Error   183 error LNK2005: __isctype already defined in MSVCRT.lib(MSVCR100.dll)    C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\LIBCMT.lib(isctype.obj)  dcmprscu
Error   184 error LNK2005: __strnicmp already defined in MSVCRT.lib(MSVCR100.dll)   C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\LIBCMT.lib(strnicmp.obj) dcmprscu
Error   185 error LNK2005: __close already defined in LIBCMT.lib(close.obj) C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\MSVCRT.lib(MSVCR100.dll) dcmprscu
Error   186 error LNK2005: __fileno already defined in LIBCMT.lib(fileno.obj)   C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\MSVCRT.lib(MSVCR100.dll) dcmprscu
Error   187 error LNK2005: _calloc already defined in LIBCMT.lib(calloc.obj)    C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\MSVCRT.lib(MSVCR100.dll) dcmprscu
Error   188 error LNK2005: _atol already defined in LIBCMT.lib(atox.obj)    C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\MSVCRT.lib(MSVCR100.dll) dcmprscu
Error   189 error LNK2005: _strcspn already defined in LIBCMT.lib(strcspn.obj)  C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\MSVCRT.lib(MSVCR100.dll) dcmprscu
Error   190 error LNK2005: __stricmp already defined in LIBCMT.lib(stricmp.obj) C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\MSVCRT.lib(MSVCR100.dll) dcmprscu
Error   191 error LNK2005: _atoi already defined in LIBCMT.lib(atox.obj)    C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\MSVCRT.lib(MSVCR100.dll) dcmprscu
Error   192 error LNK2005: __lseek already defined in LIBCMT.lib(lseek.obj) C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\MSVCRT.lib(MSVCR100.dll) dcmprscu
Error   193 error LNK2005: __read already defined in LIBCMT.lib(read.obj)   C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\MSVCRT.lib(MSVCR100.dll) dcmprscu
Error   194 error LNK2005: __write already defined in LIBCMT.lib(write.obj) C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\MSVCRT.lib(MSVCR100.dll) dcmprscu
Error   195 error LNK2005: __open already defined in LIBCMT.lib(open.obj)   C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\MSVCRT.lib(MSVCR100.dll) dcmprscu
Error   196 error LNK2005: __get_osfhandle already defined in LIBCMT.lib(osfinfo.obj)   C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\MSVCRT.lib(MSVCR100.dll) dcmprscu
Error   200 error LNK1169: one or more multiply defined symbols found   C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\Release\dcmprscu.exe dcmprscu
Error   119 error LNK2005: ___iob_func already defined in MSVCRT.lib(MSVCR100.dll)  C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\LIBCMT.lib(_file.obj)    dcmpsprt
Error   120 error LNK2005: __lock_file already defined in MSVCRT.lib(MSVCR100.dll)  C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\LIBCMT.lib(_file.obj)    dcmpsprt
Error   121 error LNK2005: __unlock_file already defined in MSVCRT.lib(MSVCR100.dll)    C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\LIBCMT.lib(_file.obj)    dcmpsprt
Error   122 error LNK2005: __initterm_e already defined in MSVCRT.lib(MSVCR100.dll) C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\LIBCMT.lib(crt0dat.obj)  dcmpsprt
Error   123 error LNK2005: _exit already defined in MSVCRT.lib(MSVCR100.dll)    C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\LIBCMT.lib(crt0dat.obj)  dcmpsprt
Error   124 error LNK2005: __exit already defined in MSVCRT.lib(MSVCR100.dll)   C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\LIBCMT.lib(crt0dat.obj)  dcmpsprt
Error   125 error LNK2005: __cexit already defined in MSVCRT.lib(MSVCR100.dll)  C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\LIBCMT.lib(crt0dat.obj)  dcmpsprt
Error   126 error LNK2005: __amsg_exit already defined in MSVCRT.lib(MSVCR100.dll)  C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\LIBCMT.lib(crt0dat.obj)  dcmpsprt
Error   127 error LNK2005: _fflush already defined in MSVCRT.lib(MSVCR100.dll)  C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\LIBCMT.lib(fflush.obj)   dcmpsprt
Error   128 error LNK2005: __errno already defined in MSVCRT.lib(MSVCR100.dll)  C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\LIBCMT.lib(dosmap.obj)   dcmpsprt
Error   129 error LNK2005: __invoke_watson already defined in MSVCRT.lib(MSVCR100.dll)  C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\LIBCMT.lib(invarg.obj)   dcmpsprt
Error   130 error LNK2005: "void __cdecl terminate(void)" (?terminate@@YAXXZ) already defined in MSVCRT.lib(MSVCR100.dll)   C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\LIBCMT.lib(hooks.obj)    dcmpsprt
Error   131 error LNK2005: ___xi_a already defined in MSVCRT.lib(cinitexe.obj)  C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\LIBCMT.lib(crt0init.obj) dcmpsprt
Error   132 error LNK2005: ___xi_z already defined in MSVCRT.lib(cinitexe.obj)  C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\LIBCMT.lib(crt0init.obj) dcmpsprt
Error   133 error LNK2005: ___xc_a already defined in MSVCRT.lib(cinitexe.obj)  C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\LIBCMT.lib(crt0init.obj) dcmpsprt
Error   134 error LNK2005: ___xc_z already defined in MSVCRT.lib(cinitexe.obj)  C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\LIBCMT.lib(crt0init.obj) dcmpsprt
Error   135 error LNK2005: __unlock already defined in MSVCRT.lib(MSVCR100.dll) C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\LIBCMT.lib(mlock.obj)    dcmpsprt
Error   136 error LNK2005: __lock already defined in MSVCRT.lib(MSVCR100.dll)   C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\LIBCMT.lib(mlock.obj)    dcmpsprt
Error   137 error LNK2005: __XcptFilter already defined in MSVCRT.lib(MSVCR100.dll) C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\LIBCMT.lib(winxfltr.obj) dcmpsprt
Error   138 error LNK2005: _mainCRTStartup already defined in MSVCRT.lib(crtexe.obj)    C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\LIBCMT.lib(crt0.obj) dcmpsprt
Error   139 error LNK2005: ___set_app_type already defined in MSVCRT.lib(MSVCR100.dll)  C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\LIBCMT.lib(errmode.obj)  dcmpsprt
Error   140 error LNK2005: __configthreadlocale already defined in MSVCRT.lib(MSVCR100.dll) C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\LIBCMT.lib(setlocal.obj) dcmpsprt
Error   141 error LNK2005: _getenv already defined in MSVCRT.lib(MSVCR100.dll)  C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\LIBCMT.lib(getenv.obj)   dcmpsprt
Error   142 error LNK2005: __isctype already defined in MSVCRT.lib(MSVCR100.dll)    C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\LIBCMT.lib(isctype.obj)  dcmpsprt
Error   143 error LNK2005: __strnicmp already defined in MSVCRT.lib(MSVCR100.dll)   C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\LIBCMT.lib(strnicmp.obj) dcmpsprt
Error   144 error LNK2005: __close already defined in LIBCMT.lib(close.obj) C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\MSVCRT.lib(MSVCR100.dll) dcmpsprt
Error   145 error LNK2005: __fileno already defined in LIBCMT.lib(fileno.obj)   C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\MSVCRT.lib(MSVCR100.dll) dcmpsprt
Error   146 error LNK2005: _calloc already defined in LIBCMT.lib(calloc.obj)    C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\MSVCRT.lib(MSVCR100.dll) dcmpsprt
Error   147 error LNK2005: _atol already defined in LIBCMT.lib(atox.obj)    C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\MSVCRT.lib(MSVCR100.dll) dcmpsprt
Error   148 error LNK2005: _strcspn already defined in LIBCMT.lib(strcspn.obj)  C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\MSVCRT.lib(MSVCR100.dll) dcmpsprt
Error   149 error LNK2005: __stricmp already defined in LIBCMT.lib(stricmp.obj) C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\MSVCRT.lib(MSVCR100.dll) dcmpsprt
Error   150 error LNK2005: _atoi already defined in LIBCMT.lib(atox.obj)    C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\MSVCRT.lib(MSVCR100.dll) dcmpsprt
Error   151 error LNK2005: __lseek already defined in LIBCMT.lib(lseek.obj) C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\MSVCRT.lib(MSVCR100.dll) dcmpsprt
Error   152 error LNK2005: __read already defined in LIBCMT.lib(read.obj)   C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\MSVCRT.lib(MSVCR100.dll) dcmpsprt
Error   153 error LNK2005: __write already defined in LIBCMT.lib(write.obj) C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\MSVCRT.lib(MSVCR100.dll) dcmpsprt
Error   154 error LNK2005: __open already defined in LIBCMT.lib(open.obj)   C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\MSVCRT.lib(MSVCR100.dll) dcmpsprt
Error   155 error LNK2005: __get_osfhandle already defined in LIBCMT.lib(osfinfo.obj)   C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\MSVCRT.lib(MSVCR100.dll) dcmpsprt
Error   159 error LNK1169: one or more multiply defined symbols found   C:\dcmtk-3.5.4-src\CMakeBinaries\dcmpstat\apps\Release\dcmpsprt.exe 1   1   dcmpsprt
Error   61  error LNK2005: ___iob_func already defined in MSVCRT.lib(MSVCR100.dll)  C:\dcmtk-3.5.4-src\CMakeBinaries\dcmsr\apps\LIBCMT.lib(_file.obj)   dsr2html
Error   62  error LNK2005: __lock_file already defined in MSVCRT.lib(MSVCR100.dll)  C:\dcmtk-3.5.4-src\CMakeBinaries\dcmsr\apps\LIBCMT.lib(_file.obj)   dsr2html
Error   63  error LNK2005: __unlock_file already defined in MSVCRT.lib(MSVCR100.dll)    C:\dcmtk-3.5.4-src\CMakeBinaries\dcmsr\apps\LIBCMT.lib(_file.obj)   dsr2html
Error   64  error LNK2005: __initterm_e already defined in MSVCRT.lib(MSVCR100.dll) C:\dcmtk-3.5.4-src\CMakeBinaries\dcmsr\apps\LIBCMT.lib(crt0dat.obj) dsr2html
Error   65  error LNK2005: _exit already defined in MSVCRT.lib(MSVCR100.dll)    C:\dcmtk-3.5.4-src\CMakeBinaries\dcmsr\apps\LIBCMT.lib(crt0dat.obj) dsr2html
Error   66  error LNK2005: __exit already defined in MSVCRT.lib(MSVCR100.dll)   C:\dcmtk-3.5.4-src\CMakeBinaries\dcmsr\apps\LIBCMT.lib(crt0dat.obj) dsr2html
Error   67  error LNK2005: __cexit already defined in MSVCRT.lib(MSVCR100.dll)  C:\dcmtk-3.5.4-src\CMakeBinaries\dcmsr\apps\LIBCMT.lib(crt0dat.obj) dsr2html
Error   68  error LNK2005: __amsg_exit already defined in MSVCRT.lib(MSVCR100.dll)  C:\dcmtk-3.5.4-src\CMakeBinaries\dcmsr\apps\LIBCMT.lib(crt0dat.obj) dsr2html
Error   69  error LNK2005: _fflush already defined in MSVCRT.lib(MSVCR100.dll)  C:\dcmtk-3.5.4-src\CMakeBinaries\dcmsr\apps\LIBCMT.lib(fflush.obj)  dsr2html
Error   70  error LNK2005: __errno already defined in MSVCRT.lib(MSVCR100.dll)  C:\dcmtk-3.5.4-src\CMakeBinaries\dcmsr\apps\LIBCMT.lib(dosmap.obj)  dsr2html
Error   71  error LNK2005: __invoke_watson already defined in MSVCRT.lib(MSVCR100.dll)  C:\dcmtk-3.5.4-src\CMakeBinaries\dcmsr\apps\LIBCMT.lib(invarg.obj)  dsr2html
Error   72  error LNK2005: "void __cdecl terminate(void)" (?terminate@@YAXXZ) already defined in MSVCRT.lib(MSVCR100.dll)   C:\dcmtk-3.5.4-src\CMakeBinaries\dcmsr\apps\LIBCMT.lib(hooks.obj)   dsr2html
Error   73  error LNK2005: ___xi_a already defined in MSVCRT.lib(cinitexe.obj)  C:\dcmtk-3.5.4-src\CMakeBinaries\dcmsr\apps\LIBCMT.lib(crt0init.obj)    dsr2html
Error   74  error LNK2005: ___xi_z already defined in MSVCRT.lib(cinitexe.obj)  C:\dcmtk-3.5.4-src\CMakeBinaries\dcmsr\apps\LIBCMT.lib(crt0init.obj)    dsr2html
Error   75  error LNK2005: ___xc_a already defined in MSVCRT.lib(cinitexe.obj)  C:\dcmtk-3.5.4-src\CMakeBinaries\dcmsr\apps\LIBCMT.lib(crt0init.obj)    dsr2html
Error   76  error LNK2005: ___xc_z already defined in MSVCRT.lib(cinitexe.obj)  C:\dcmtk-3.5.4-src\CMakeBinaries\dcmsr\apps\LIBCMT.lib(crt0init.obj)    dsr2html
Error   77  error LNK2005: __unlock already defined in MSVCRT.lib(MSVCR100.dll) C:\dcmtk-3.5.4-src\CMakeBinaries\dcmsr\apps\LIBCMT.lib(mlock.obj)   dsr2html
Error   78  error LNK2005: __lock already defined in MSVCRT.lib(MSVCR100.dll)   C:\dcmtk-3.5.4-src\CMakeBinaries\dcmsr\apps\LIBCMT.lib(mlock.obj)   dsr2html
Error   79  error LNK2005: __XcptFilter already defined in MSVCRT.lib(MSVCR100.dll) C:\dcmtk-3.5.4-src\CMakeBinaries\dcmsr\apps\LIBCMT.lib(winxfltr.obj)    dsr2html
Error   80  error LNK2005: _mainCRTStartup already defined in MSVCRT.lib(crtexe.obj)    C:\dcmtk-3.5.4-src\CMakeBinaries\dcmsr\apps\LIBCMT.lib(crt0.obj)    dsr2html
Error   81  error LNK2005: ___set_app_type already defined in 

EDITAR:

Observaciones:

  1. Solo existen conflictos entre LIBCMT.LIB y MSVCRT.LIB
  2. Estos dos archivos LIB no existen en las ubicaciones que se muestran en los errores.

EDIT2:

Sí, el problema se debe a que algunas de las bibliotecas de soporte no se crearon con / MD. Entonces, yo mismo construí todas las bibliotecas de soporte con / MD y mi problema se resolvió.

Respuestas:


121

Está mezclando código compilado con / MD (use la versión DLL de CRT) con código compilado con / MT (use la biblioteca CRT estática). Eso no puede funcionar, todos los archivos de código fuente deben compilarse con la misma configuración. Dado que usa bibliotecas que fueron precompiladas con / MD, casi siempre la configuración correcta, también debe compilar su propio código con esta configuración.

Proyecto + Propiedades, C / C ++, Generación de código, Biblioteca en tiempo de ejecución.

Tenga en cuenta que estas bibliotecas probablemente se compilaron con una versión anterior de CRT, msvcr100.dll es bastante nuevo. No estoy seguro de si eso causará problemas, es posible que deba evitar que el vinculador genere un manifiesto. También debe asegurarse de implementar las DLL que necesita en la máquina de destino, incluido msvcr100.dll


1
Creo que te perdiste este punto en mi pregunta: In each project of DCMTK solution (source code) I ensured that runtime options are "Multithreaded DLL" (/MD). But still I'm getting these errors.En la solución DCMTK (hay alrededor de 62 proyectos). Para cada proyecto, he verificado la configuración Proyecto + Propiedades, C / C ++, Generación de código, Biblioteca en tiempo de ejecución y es / MD. Incluso después de esto, recibo este error.
volpack

2
El enlazador está discutiendo con tu declaración, no conmigo. Tenga cuidado con uno de estos proyectos "dcmtk" que utilizan un .lib que está mal compilado.
Hans Passant

1
Edité mi pregunta. ¿Tienes algo que comentar sobre el segundo punto de mi edición?
volpack

1
Bueno, la ubicación de LIBCMT en el mensaje de error es muy extraña, no pertenece allí. La única buena suposición es que el enlazador está seleccionando una versión prediseñada de una biblioteca en lugar de la que usted mismo reconstruyó.
Hans Passant

1
"versión prediseñada de una biblioteca en lugar de la que usted mismo reconstruyó". No construí ningún LIBCMT / MSVCRT. Lo más importante es que no hay LIBCMT.LIB o MSVCRT.LIB en ninguna de las ubicaciones mencionadas.
volpack

3

Recibiendo este error, cambié el

c/C++ > Code Generation > Runtime Library to Multi-threaded library (DLL) /MD

tanto para el proyecto de código como para el proyecto de prueba de Google asociado. Esto resolvió el problema.

Nota: todos los componentes del proyecto deben tener la misma definición en c / C ++> Generación de código> Biblioteca en tiempo de ejecución. DLL o no DLL, pero idéntico.


2

Algunos lectores tendrán otro problema y necesitarán esta solución. lea los enlaces a continuación. el mismo problema ocurrió con Visual Studio 2015 con la llegada de Windows SDK 10 que muestra libucrt. ucrt es la implementación de Windows de C Runtime (CRT) también conocida como la biblioteca de tiempo de ejecución posix. Lo más probable es que tenga un código que fue portado desde unix ... Bienvenido al inconveniente

https://support.microsoft.com/en-us/help/148652/a-lnk2005-error-occurs-when-the-crt-library-and-mfc-libraries-are-linked-in-the-wrong- orden-en-visual-c

https://github.com/lordmulder/libsndfile-MSVC/blob/master/src/sf_unistd.h

https://lists.gnu.org/archive/html/bug-gnulib/2011-09/msg00224.html

https://msdn.microsoft.com/en-us/library/y23kc048.aspx

https://blogs.msdn.microsoft.com/vcblog/2015/03/03/introducing-the-universal-crt/


1

Si su solución VS contiene varios proyectos, selecciónelos todos en el panel derecho y presione "propiedades". Luego vaya a C ++ -> Generación de código y elija una opción de biblioteca de tiempo de ejecución para todos ellos

Al usar nuestro sitio, usted reconoce que ha leído y comprende nuestra Política de Cookies y Política de Privacidad.
Licensed under cc by-sa 3.0 with attribution required.