How to fix the following linker errors in Visual Studio?

Here is my script. I have a project that contains 30 subprojects. In one of the projects, I used the CLR (common runtime), so I changed its runtime using / mdd (multi-threaded debugging DLL).

Individually, all projects have been successfully built. But when I try to compile the main project, I get the following linker errors:

LINK : warning LNK4098: defaultlib 'MSVCRTD' conflicts with use of other libs; use /NODEFAULTLIB:library LIBCMTD.lib(winxfltr.obj) : error LNK2005: __XcptFilter already defined in MSVCRTD.lib(MSVCR80D.dll) LIBCMTD.lib(invarg.obj) : error LNK2005: __invalid_parameter already defined in MSVCRTD.lib(MSVCR80D.dll) LIBCMTD.lib(invarg.obj) : error LNK2005: __invoke_watson already defined in MSVCRTD.lib(MSVCR80D.dll) LIBCMTD.lib(crt0.obj) : error LNK2005: _mainCRTStartup already defined in MSVCRTD.lib(crtexe.obj) LIBCMTD.lib(fclose.obj) : error LNK2005: _fclose already defined in MSVCRTD.lib(MSVCR80D.dll) LIBCMTD.lib(printf.obj) : error LNK2005: _printf already defined in MSVCRTD.lib(MSVCR80D.dll) LIBCMTD.lib(mbstowcs.obj) : error LNK2005: _mbstowcs already defined in MSVCRTD.lib(MSVCR80D.dll) LIBCMTD.lib(dbgrptw.obj) : error LNK2005: __CrtDbgReportW already defined in MSVCRTD.lib(MSVCR80D.dll) LIBCMTD.lib(wcstombs.obj) : error LNK2005: _wcstombs already defined in MSVCRTD.lib(MSVCR80D.dll) LIBCMTD.lib(tzset.obj) : error LNK2005: __tzset already defined in MSVCRTD.lib(MSVCR80D.dll) LIBCMTD.lib(stricmp.obj) : error LNK2005: __stricmp already defined in MSVCRTD.lib(MSVCR80D.dll) 

How to solve all these problems?

+6
clr visual-studio-2008 visual-studio
source share
2 answers

LIBCMTD is a debugging version of the static multi-threaded C runtime library. MSVCR80D is a debugging version of the multithreaded DLL-based runtime library. Some of your subprojects require one, the other require another. This is Microsoft's confusion, but you have to deal with it. Select one, say, a multi-threaded debugging DLL, and use it exclusively for the Debug version of your project and all subprojects. The Microsoft license (I said) requires that you use a non-debug version of the released software.

For more information, see the following: CLICK.

Screenshot

+22
source share

It looks like some of your projects use a static runtime library. (And you chose the dynamics for one of your projects) This combination is not supported.

Reminds me: Linker errors between multiple projects in Visual C ++

+8
source share

All Articles