解决LNK4098:defaultlib' MSVCRT'与(DCMTK)和LNK2038 / LNK2005发生冲突

时间:2015-01-26 08:22:26

标签: c++ visual-studio-2013 runtime dcmtk

我在Visual Studio 2013中使用C ++语言的项目中使用DCMTK 3.6.1库。我的代码在调试模式下完美运行,但在发布模式下没有;当我尝试编译它时,我有275个错误:

dcmdata.lib(dcdatset.obj):错误LNK2038:检测到不匹配

'_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in testapp_new.obj
2>dcmdata.lib(dcdatset.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MDd_DynamicDebug' doesn't match value 'MD_DynamicRelease' in testapp_new.obj
2>dcmdata.lib(dcfilefo.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in testapp_new.obj
2>dcmdata.lib(dcfilefo.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MDd_DynamicDebug' doesn't match value 'MD_DynamicRelease' in testapp_new.obj
2>dcmdata.lib(dcxfer.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in testapp_new.obj
2>dcmdata.lib(dcxfer.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MDd_DynamicDebug' doesn't match value 'MD_DynamicRelease' in testapp_new.obj
2>dcmdata.lib(dctagkey.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in testapp_new.obj
2>dcmdata.lib(dctagkey.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MDd_DynamicDebug' doesn't match value 'MD_DynamicRelease' in testapp_new.obj
2>dcmdata.lib(dctag.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in testapp_new.obj
2>dcmdata.lib(dctag.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MDd_DynamicDebug' doesn't match value 'MD_DynamicRelease' in testapp_new.obj
2>dcmdata.lib(dcstack.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in testapp_new.obj

我在网上尝试了很多解决方案,但没有任何效果......

如果我尝试在发布模式下编译DCMTL库,我会遇到以下错误:

Error   4   error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in dcmdjpls.obj C:\dcmtk-bin_2\dcmjpls\apps\charls.lib(intrface.obj)
Error   5   error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in dcmdjpls.obj C:\dcmtk-bin_2\dcmjpls\apps\charls.lib(header.obj)
Error   6   error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in dcmdjpls.obj C:\dcmtk-bin_2\dcmjpls\apps\charls.lib(jpegls.obj)
Error   7   error LNK2005: __invoke_watson already defined in MSVCRT.lib(MSVCR120.dll)  C:\dcmtk-bin_2\dcmjpls\apps\LIBCMT.lib(invarg.obj)
Error   8   error LNK2005: ___crtSetUnhandledExceptionFilter already defined in MSVCRT.lib(MSVCR120.dll)    C:\dcmtk-bin_2\dcmjpls\apps\LIBCMT.lib(winapisupp.obj)
Error   9   error LNK2005: ___crtTerminateProcess already defined in MSVCRT.lib(MSVCR120.dll)   C:\dcmtk-bin_2\dcmjpls\apps\LIBCMT.lib(winapisupp.obj)
Error   10  error LNK2005: ___crtUnhandledException already defined in MSVCRT.lib(MSVCR120.dll) C:\dcmtk-bin_2\dcmjpls\apps\LIBCMT.lib(winapisupp.obj)
Error   11  error LNK2005: ___iob_func already defined in MSVCRT.lib(MSVCR120.dll)  C:\dcmtk-bin_2\dcmjpls\apps\LIBCMT.lib(_file.obj)
Error   12  error LNK2005: __lock_file already defined in MSVCRT.lib(MSVCR120.dll)  C:\dcmtk-bin_2\dcmjpls\apps\LIBCMT.lib(_file.obj)
Error   13  error LNK2005: __unlock_file already defined in MSVCRT.lib(MSVCR120.dll)    C:\dcmtk-bin_2\dcmjpls\apps\LIBCMT.lib(_file.obj)
Error   14  error LNK2005: _fflush already defined in MSVCRT.lib(MSVCR120.dll)  C:\dcmtk-bin_2\dcmjpls\apps\LIBCMT.lib(fflush.obj)
Error   15  error LNK2005: __amsg_exit already defined in MSVCRT.lib(MSVCR120.dll)  C:\dcmtk-bin_2\dcmjpls\apps\LIBCMT.lib(crt0dat.obj)
Error   16  error LNK2005: __cexit already defined in MSVCRT.lib(MSVCR120.dll)  C:\dcmtk-bin_2\dcmjpls\apps\LIBCMT.lib(crt0dat.obj)
Error   17  error LNK2005: __exit already defined in MSVCRT.lib(MSVCR120.dll)   C:\dcmtk-bin_2\dcmjpls\apps\LIBCMT.lib(crt0dat.obj)
Error   18  error LNK2005: __initterm_e already defined in MSVCRT.lib(MSVCR120.dll) C:\dcmtk-bin_2\dcmjpls\apps\LIBCMT.lib(crt0dat.obj)
Error   19  error LNK2005: _exit already defined in MSVCRT.lib(MSVCR120.dll)    C:\dcmtk-bin_2\dcmjpls\apps\LIBCMT.lib(crt0dat.obj)
Error   20  error LNK2005: __errno already defined in MSVCRT.lib(MSVCR120.dll)  C:\dcmtk-bin_2\dcmjpls\apps\LIBCMT.lib(dosmap.obj)
Error   21  error LNK2005: __calloc_crt already defined in MSVCRT.lib(MSVCR120.dll) C:\dcmtk-bin_2\dcmjpls\apps\LIBCMT.lib(crtheap.obj)
Error   22  error LNK2005: "void __cdecl terminate(void)" (?terminate@@YAXXZ) already defined in MSVCRT.lib(MSVCR120.dll)   C:\dcmtk-bin_2\dcmjpls\apps\LIBCMT.lib(hooks.obj)
Error   23  error LNK2005: ___xi_a already defined in MSVCRT.lib(cinitexe.obj)  C:\dcmtk-bin_2\dcmjpls\apps\LIBCMT.lib(crt0init.obj)
Error   24  error LNK2005: ___xi_z already defined in MSVCRT.lib(cinitexe.obj)  C:\dcmtk-bin_2\dcmjpls\apps\LIBCMT.lib(crt0init.obj)
Error   25  error LNK2005: ___xc_a already defined in MSVCRT.lib(cinitexe.obj)  C:\dcmtk-bin_2\dcmjpls\apps\LIBCMT.lib(crt0init.obj)
Error   26  error LNK2005: ___xc_z already defined in MSVCRT.lib(cinitexe.obj)  C:\dcmtk-bin_2\dcmjpls\apps\LIBCMT.lib(crt0init.obj)
Error   27  error LNK2005: __get_osfhandle already defined in MSVCRT.lib(MSVCR120.dll)  C:\dcmtk-bin_2\dcmjpls\apps\LIBCMT.lib(osfinfo.obj)
Error   28  error LNK2005: ___set_app_type already defined in MSVCRT.lib(MSVCR120.dll)  C:\dcmtk-bin_2\dcmjpls\apps\LIBCMT.lib(errmode.obj)
Error   29  error LNK2005: __XcptFilter already defined in MSVCRT.lib(MSVCR120.dll) C:\dcmtk-bin_2\dcmjpls\apps\LIBCMT.lib(winxfltr.obj)
Error   30  error LNK2005: __lock already defined in MSVCRT.lib(MSVCR120.dll)   C:\dcmtk-bin_2\dcmjpls\apps\LIBCMT.lib(mlock.obj)
Error   31  error LNK2005: __unlock already defined in MSVCRT.lib(MSVCR120.dll) C:\dcmtk-bin_2\dcmjpls\apps\LIBCMT.lib(mlock.obj)
Error   32  error LNK2005: __configthreadlocale already defined in MSVCRT.lib(MSVCR120.dll) C:\dcmtk-bin_2\dcmjpls\apps\LIBCMT.lib(wsetloca.obj)
Error   33  error LNK2005: __fileno already defined in LIBCMT.lib(fileno.obj)   C:\dcmtk-bin_2\dcmjpls\apps\MSVCRT.lib(MSVCR120.dll)
Warning 34  warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library    C:\dcmtk-bin_2\dcmjpls\apps\LINK
Warning 35  warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library    C:\dcmtk-bin_2\dcmjpls\apps\LINK
Error   36  error LNK1169: one or more multiply defined symbols found   C:\dcmtk-bin_2\bin\Release\dcmdjpls.exe
Error   37  error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in dcml2pnm.obj C:\dcmtk-bin_2\dcmjpls\apps\charls.lib(intrface.obj)
Error   38  error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in dcml2pnm.obj C:\dcmtk-bin_2\dcmjpls\apps\charls.lib(header.obj)
Error   39  error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in dcml2pnm.obj C:\dcmtk-bin_2\dcmjpls\apps\charls.lib(jpegls.obj)
Error   40  error LNK2005: __invoke_watson already defined in MSVCRT.lib(MSVCR120.dll)  C:\dcmtk-bin_2\dcmjpls\apps\LIBCMT.lib(invarg.obj)
Error   41  error LNK2005: ___crtSetUnhandledExceptionFilter already defined in MSVCRT.lib(MSVCR120.dll)    C:\dcmtk-bin_2\dcmjpls\apps\LIBCMT.lib(winapisupp.obj)
Error   42  error LNK2005: ___crtTerminateProcess already defined in MSVCRT.lib(MSVCR120.dll)   C:\dcmtk-bin_2\dcmjpls\apps\LIBCMT.lib(winapisupp.obj)
Error   43  error LNK2005: ___crtUnhandledException already defined in MSVCRT.lib(MSVCR120.dll) C:\dcmtk-bin_2\dcmjpls\apps\LIBCMT.lib(winapisupp.obj)
Error   44  error LNK2005: ___iob_func already defined in MSVCRT.lib(MSVCR120.dll)  C:\dcmtk-bin_2\dcmjpls\apps\LIBCMT.lib(_file.obj)
Error   45  error LNK2005: __lock_file already defined in MSVCRT.lib(MSVCR120.dll)  C:\dcmtk-bin_2\dcmjpls\apps\LIBCMT.lib(_file.obj)
Error   46  error LNK2005: __unlock_file already defined in MSVCRT.lib(MSVCR120.dll)    C:\dcmtk-bin_2\dcmjpls\apps\LIBCMT.lib(_file.obj)
Error   47  error LNK2005: _fflush already defined in MSVCRT.lib(MSVCR120.dll)  C:\dcmtk-bin_2\dcmjpls\apps\LIBCMT.lib(fflush.obj)
Error   48  error LNK2005: __amsg_exit already defined in MSVCRT.lib(MSVCR120.dll)  C:\dcmtk-bin_2\dcmjpls\apps\LIBCMT.lib(crt0dat.obj)
Error   49  error LNK2005: __cexit already defined in MSVCRT.lib(MSVCR120.dll)  C:\dcmtk-bin_2\dcmjpls\apps\LIBCMT.lib(crt0dat.obj)
Error   50  error LNK2005: __exit already defined in MSVCRT.lib(MSVCR120.dll)   C:\dcmtk-bin_2\dcmjpls\apps\LIBCMT.lib(crt0dat.obj)
Error   51  error LNK2005: __initterm_e already defined in MSVCRT.lib(MSVCR120.dll) C:\dcmtk-bin_2\dcmjpls\apps\LIBCMT.lib(crt0dat.obj)
Error   52  error LNK2005: _exit already defined in MSVCRT.lib(MSVCR120.dll)    C:\dcmtk-bin_2\dcmjpls\apps\LIBCMT.lib(crt0dat.obj)
Error   53  error LNK2005: __errno already defined in MSVCRT.lib(MSVCR120.dll)  C:\dcmtk-bin_2\dcmjpls\apps\LIBCMT.lib(dosmap.obj)
Error   54  error LNK2005: __calloc_crt already defined in MSVCRT.lib(MSVCR120.dll) C:\dcmtk-bin_2\dcmjpls\apps\LIBCMT.lib(crtheap.obj)
Error   55  error LNK2005: "void __cdecl terminate(void)" (?terminate@@YAXXZ) already defined in MSVCRT.lib(MSVCR120.dll)   C:\dcmtk-bin_2\dcmjpls\apps\LIBCMT.lib(hooks.obj)
Error   56  error LNK2005: ___xi_a already defined in MSVCRT.lib(cinitexe.obj)  C:\dcmtk-bin_2\dcmjpls\apps\LIBCMT.lib(crt0init.obj)
Error   57  error LNK2005: ___xi_z already defined in MSVCRT.lib(cinitexe.obj)  C:\dcmtk-bin_2\dcmjpls\apps\LIBCMT.lib(crt0init.obj)
Error   58  error LNK2005: ___xc_a already defined in MSVCRT.lib(cinitexe.obj)  C:\dcmtk-bin_2\dcmjpls\apps\LIBCMT.lib(crt0init.obj)
Error   59  error LNK2005: ___xc_z already defined in MSVCRT.lib(cinitexe.obj)  C:\dcmtk-bin_2\dcmjpls\apps\LIBCMT.lib(crt0init.obj)
Error   60  error LNK2005: __get_osfhandle already defined in MSVCRT.lib(MSVCR120.dll)  C:\dcmtk-bin_2\dcmjpls\apps\LIBCMT.lib(osfinfo.obj)
Error   61  error LNK2005: ___set_app_type already defined in MSVCRT.lib(MSVCR120.dll)  C:\dcmtk-bin_2\dcmjpls\apps\LIBCMT.lib(errmode.obj)
Error   62  error LNK2005: __XcptFilter already defined in MSVCRT.lib(MSVCR120.dll) C:\dcmtk-bin_2\dcmjpls\apps\LIBCMT.lib(winxfltr.obj)
Error   63  error LNK2005: __lock already defined in MSVCRT.lib(MSVCR120.dll)   C:\dcmtk-bin_2\dcmjpls\apps\LIBCMT.lib(mlock.obj)
Error   64  error LNK2005: __unlock already defined in MSVCRT.lib(MSVCR120.dll) C:\dcmtk-bin_2\dcmjpls\apps\LIBCMT.lib(mlock.obj)
Error   65  error LNK2005: __configthreadlocale already defined in MSVCRT.lib(MSVCR120.dll) C:\dcmtk-bin_2\dcmjpls\apps\LIBCMT.lib(wsetloca.obj)
Error   66  error LNK2005: __fileno already defined in LIBCMT.lib(fileno.obj)   C:\dcmtk-bin_2\dcmjpls\apps\MSVCRT.lib(MSVCR120.dll)
Warning 67  warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library    C:\dcmtk-bin_2\dcmjpls\apps\LINK
Warning 68  warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library    C:\dcmtk-bin_2\dcmjpls\apps\LINK
Error   69  error LNK1169: one or more multiply defined symbols found   C:\dcmtk-bin_2\bin\Release\dcml2pnm.exe
Error   70  error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in dcmcjpls.obj C:\dcmtk-bin_2\dcmjpls\apps\charls.lib(intrface.obj)
Error   71  error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in dcmcjpls.obj C:\dcmtk-bin_2\dcmjpls\apps\charls.lib(header.obj)
Error   72  error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in dcmcjpls.obj C:\dcmtk-bin_2\dcmjpls\apps\charls.lib(jpegls.obj)
Error   73  error LNK2005: __invoke_watson already defined in MSVCRT.lib(MSVCR120.dll)  C:\dcmtk-bin_2\dcmjpls\apps\LIBCMT.lib(invarg.obj)
Error   74  error LNK2005: ___crtSetUnhandledExceptionFilter already defined in MSVCRT.lib(MSVCR120.dll)    C:\dcmtk-bin_2\dcmjpls\apps\LIBCMT.lib(winapisupp.obj)
Error   75  error LNK2005: ___crtTerminateProcess already defined in MSVCRT.lib(MSVCR120.dll)   C:\dcmtk-bin_2\dcmjpls\apps\LIBCMT.lib(winapisupp.obj)
Error   76  error LNK2005: ___crtUnhandledException already defined in MSVCRT.lib(MSVCR120.dll) C:\dcmtk-bin_2\dcmjpls\apps\LIBCMT.lib(winapisupp.obj)
Error   77  error LNK2005: ___iob_func already defined in MSVCRT.lib(MSVCR120.dll)  C:\dcmtk-bin_2\dcmjpls\apps\LIBCMT.lib(_file.obj)
Error   78  error LNK2005: __lock_file already defined in MSVCRT.lib(MSVCR120.dll)  C:\dcmtk-bin_2\dcmjpls\apps\LIBCMT.lib(_file.obj)
Error   79  error LNK2005: __unlock_file already defined in MSVCRT.lib(MSVCR120.dll)    C:\dcmtk-bin_2\dcmjpls\apps\LIBCMT.lib(_file.obj)
Error   80  error LNK2005: _fflush already defined in MSVCRT.lib(MSVCR120.dll)  C:\dcmtk-bin_2\dcmjpls\apps\LIBCMT.lib(fflush.obj)
Error   81  error LNK2005: __amsg_exit already defined in MSVCRT.lib(MSVCR120.dll)  C:\dcmtk-bin_2\dcmjpls\apps\LIBCMT.lib(crt0dat.obj)
Error   82  error LNK2005: __cexit already defined in MSVCRT.lib(MSVCR120.dll)  C:\dcmtk-bin_2\dcmjpls\apps\LIBCMT.lib(crt0dat.obj)
Error   83  error LNK2005: __exit already defined in MSVCRT.lib(MSVCR120.dll)   C:\dcmtk-bin_2\dcmjpls\apps\LIBCMT.lib(crt0dat.obj)
Error   84  error LNK2005: __initterm_e already defined in MSVCRT.lib(MSVCR120.dll) C:\dcmtk-bin_2\dcmjpls\apps\LIBCMT.lib(crt0dat.obj)
Error   85  error LNK2005: _exit already defined in MSVCRT.lib(MSVCR120.dll)    C:\dcmtk-bin_2\dcmjpls\apps\LIBCMT.lib(crt0dat.obj)
Error   86  error LNK2005: __errno already defined in MSVCRT.lib(MSVCR120.dll)  C:\dcmtk-bin_2\dcmjpls\apps\LIBCMT.lib(dosmap.obj)
Error   87  error LNK2005: __calloc_crt already defined in MSVCRT.lib(MSVCR120.dll) C:\dcmtk-bin_2\dcmjpls\apps\LIBCMT.lib(crtheap.obj)
Error   88  error LNK2005: "void __cdecl terminate(void)" (?terminate@@YAXXZ) already defined in MSVCRT.lib(MSVCR120.dll)   C:\dcmtk-bin_2\dcmjpls\apps\LIBCMT.lib(hooks.obj)
Error   89  error LNK2005: ___xi_a already defined in MSVCRT.lib(cinitexe.obj)  C:\dcmtk-bin_2\dcmjpls\apps\LIBCMT.lib(crt0init.obj)
Error   90  error LNK2005: ___xi_z already defined in MSVCRT.lib(cinitexe.obj)  C:\dcmtk-bin_2\dcmjpls\apps\LIBCMT.lib(crt0init.obj)
Error   91  error LNK2005: ___xc_a already defined in MSVCRT.lib(cinitexe.obj)  C:\dcmtk-bin_2\dcmjpls\apps\LIBCMT.lib(crt0init.obj)
Error   92  error LNK2005: ___xc_z already defined in MSVCRT.lib(cinitexe.obj)  C:\dcmtk-bin_2\dcmjpls\apps\LIBCMT.lib(crt0init.obj)
Error   93  error LNK2005: __get_osfhandle already defined in MSVCRT.lib(MSVCR120.dll)  C:\dcmtk-bin_2\dcmjpls\apps\LIBCMT.lib(osfinfo.obj)
Error   94  error LNK2005: ___set_app_type already defined in MSVCRT.lib(MSVCR120.dll)  C:\dcmtk-bin_2\dcmjpls\apps\LIBCMT.lib(errmode.obj)
Error   95  error LNK2005: __XcptFilter already defined in MSVCRT.lib(MSVCR120.dll) C:\dcmtk-bin_2\dcmjpls\apps\LIBCMT.lib(winxfltr.obj)
Error   96  error LNK2005: __lock already defined in MSVCRT.lib(MSVCR120.dll)   C:\dcmtk-bin_2\dcmjpls\apps\LIBCMT.lib(mlock.obj)
Error   97  error LNK2005: __unlock already defined in MSVCRT.lib(MSVCR120.dll) C:\dcmtk-bin_2\dcmjpls\apps\LIBCMT.lib(mlock.obj)
Error   98  error LNK2005: __configthreadlocale already defined in MSVCRT.lib(MSVCR120.dll) C:\dcmtk-bin_2\dcmjpls\apps\LIBCMT.lib(wsetloca.obj)
Error   99  error LNK2005: __fileno already defined in LIBCMT.lib(fileno.obj)   C:\dcmtk-bin_2\dcmjpls\apps\MSVCRT.lib(MSVCR120.dll)
Warning 100 warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library    C:\dcmtk-bin_2\dcmjpls\apps\LINK
Warning 101 warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library    C:\dcmtk-bin_2\dcmjpls\apps\LINK
Error   102 error LNK1169: one or more multiply defined symbols found   C:\dcmtk-bin_2\bin\Release\dcmcjpls.exe
Error   103 error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in dcmsend.obj  C:\dcmtk-bin_2\dcmnet\apps\charls.lib(intrface.obj)
Error   104 error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in dcmsend.obj  C:\dcmtk-bin_2\dcmnet\apps\charls.lib(header.obj)
Error   105 error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in dcmsend.obj  C:\dcmtk-bin_2\dcmnet\apps\charls.lib(jpegls.obj)
Error   106 error LNK2005: __invoke_watson already defined in MSVCRT.lib(MSVCR120.dll)  C:\dcmtk-bin_2\dcmnet\apps\LIBCMT.lib(invarg.obj)
Error   107 error LNK2005: ___crtSetUnhandledExceptionFilter already defined in MSVCRT.lib(MSVCR120.dll)    C:\dcmtk-bin_2\dcmnet\apps\LIBCMT.lib(winapisupp.obj)
Error   108 error LNK2005: ___crtTerminateProcess already defined in MSVCRT.lib(MSVCR120.dll)   C:\dcmtk-bin_2\dcmnet\apps\LIBCMT.lib(winapisupp.obj)
Error   109 error LNK2005: ___crtUnhandledException already defined in MSVCRT.lib(MSVCR120.dll) C:\dcmtk-bin_2\dcmnet\apps\LIBCMT.lib(winapisupp.obj)
Error   110 error LNK2005: ___iob_func already defined in MSVCRT.lib(MSVCR120.dll)  C:\dcmtk-bin_2\dcmnet\apps\LIBCMT.lib(_file.obj)
Error   111 error LNK2005: __lock_file already defined in MSVCRT.lib(MSVCR120.dll)  C:\dcmtk-bin_2\dcmnet\apps\LIBCMT.lib(_file.obj)
Error   112 error LNK2005: __unlock_file already defined in MSVCRT.lib(MSVCR120.dll)    C:\dcmtk-bin_2\dcmnet\apps\LIBCMT.lib(_file.obj)
Error   113 error LNK2005: _fflush already defined in MSVCRT.lib(MSVCR120.dll)  C:\dcmtk-bin_2\dcmnet\apps\LIBCMT.lib(fflush.obj)
Error   114 error LNK2005: __amsg_exit already defined in MSVCRT.lib(MSVCR120.dll)  C:\dcmtk-bin_2\dcmnet\apps\LIBCMT.lib(crt0dat.obj)
Error   115 error LNK2005: __cexit already defined in MSVCRT.lib(MSVCR120.dll)  C:\dcmtk-bin_2\dcmnet\apps\LIBCMT.lib(crt0dat.obj)
Error   116 error LNK2005: __exit already defined in MSVCRT.lib(MSVCR120.dll)   C:\dcmtk-bin_2\dcmnet\apps\LIBCMT.lib(crt0dat.obj)
Error   117 error LNK2005: __initterm_e already defined in MSVCRT.lib(MSVCR120.dll) C:\dcmtk-bin_2\dcmnet\apps\LIBCMT.lib(crt0dat.obj)
Error   118 error LNK2005: _exit already defined in MSVCRT.lib(MSVCR120.dll)    C:\dcmtk-bin_2\dcmnet\apps\LIBCMT.lib(crt0dat.obj)
Error   119 error LNK2005: __errno already defined in MSVCRT.lib(MSVCR120.dll)  C:\dcmtk-bin_2\dcmnet\apps\LIBCMT.lib(dosmap.obj)
Error   120 error LNK2005: __calloc_crt already defined in MSVCRT.lib(MSVCR120.dll) C:\dcmtk-bin_2\dcmnet\apps\LIBCMT.lib(crtheap.obj)
Error   121 error LNK2005: "void __cdecl terminate(void)" (?terminate@@YAXXZ) already defined in MSVCRT.lib(MSVCR120.dll)   C:\dcmtk-bin_2\dcmnet\apps\LIBCMT.lib(hooks.obj)
Error   122 error LNK2005: ___xi_a already defined in MSVCRT.lib(cinitexe.obj)  C:\dcmtk-bin_2\dcmnet\apps\LIBCMT.lib(crt0init.obj)
Error   123 error LNK2005: ___xi_z already defined in MSVCRT.lib(cinitexe.obj)  C:\dcmtk-bin_2\dcmnet\apps\LIBCMT.lib(crt0init.obj)
Error   124 error LNK2005: ___xc_a already defined in MSVCRT.lib(cinitexe.obj)  C:\dcmtk-bin_2\dcmnet\apps\LIBCMT.lib(crt0init.obj)
Error   125 error LNK2005: ___xc_z already defined in MSVCRT.lib(cinitexe.obj)  C:\dcmtk-bin_2\dcmnet\apps\LIBCMT.lib(crt0init.obj)
Error   126 error LNK2005: __get_osfhandle already defined in MSVCRT.lib(MSVCR120.dll)  C:\dcmtk-bin_2\dcmnet\apps\LIBCMT.lib(osfinfo.obj)
Error   127 error LNK2005: ___set_app_type already defined in MSVCRT.lib(MSVCR120.dll)  C:\dcmtk-bin_2\dcmnet\apps\LIBCMT.lib(errmode.obj)
Error   128 error LNK2005: __XcptFilter already defined in MSVCRT.lib(MSVCR120.dll) C:\dcmtk-bin_2\dcmnet\apps\LIBCMT.lib(winxfltr.obj)
Error   129 error LNK2005: __lock already defined in MSVCRT.lib(MSVCR120.dll)   C:\dcmtk-bin_2\dcmnet\apps\LIBCMT.lib(mlock.obj)
Error   130 error LNK2005: __unlock already defined in MSVCRT.lib(MSVCR120.dll) C:\dcmtk-bin_2\dcmnet\apps\LIBCMT.lib(mlock.obj)
Error   131 error LNK2005: __configthreadlocale already defined in MSVCRT.lib(MSVCR120.dll) C:\dcmtk-bin_2\dcmnet\apps\LIBCMT.lib(wsetloca.obj)
Error   132 error LNK2005: __fileno already defined in LIBCMT.lib(fileno.obj)   C:\dcmtk-bin_2\dcmnet\apps\MSVCRT.lib(MSVCR120.dll)

你知道如何解决这个问题吗?

3 个答案:

答案 0 :(得分:3)

根据DCMTK官方论坛的建议,我已经重新编译了DCMTK库并禁用了标志DCMTK_OVERWRITE_WIN32_COMPILER_FLAGS,现在我可以在调试/发布模式下编译了,所以工作正常!

我需要在调试模式下安装库,然后在发布模式下安装

无论如何,我会更多地研究这些东西。

答案 1 :(得分:1)

您正在混合Debug / Release和Dynamic / Static库。

首先,你有

mismatch detected for 'RuntimeLibrary': value 'MDd_DynamicDebug' doesn't match value 'MD_DynamicRelease'

第二次,你有:

mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease'

所以你用static + release替换了dynamic + debug。你解决了一半的问题,但搞砸了另一半!

我建议重新编译库,但是在动态+发布配置中。或者在静态+发布配置中编译你的项目,但你想要的当然是由你决定的。

答案 2 :(得分:0)

您使用的库可能是具有不同VS版本的编译器。因此,只有在重新编译所获得的库时才能解决此问题。

或者您使用不同的设置来使用CRT(静态和动态链接)。

查看readmes!他们没有提到VS-2013!

您是否可以使用编译器标志来忽略默认库?如果您使用使用其他VS版本创建的静态库,这绝不是一个好方法。