如何解决Visual Studio中的以下链接器错误? [英] How to resolve the following linker errors in Visual Studio?

查看:120
本文介绍了如何解决Visual Studio中的以下链接器错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的场景.我有一个包含30个子项目的项目.在其中一个项目中,我使用了CLR(公共语言运行时),因此我使用/mdd(多线程调试DLL)修改了其运行时.

Here is My scenario. I have a project which contains 30 subprojects. In one of the projects I have used CLR (common language runtime) so I modified its runtime with /mdd (multi threaded debug DLL).

单独完成所有项目.但是当我尝试编译主 项目中,我收到以下链接器错误:

Individually all the projects are built successfully. But when I try to compile the main project I am getting 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 resolve these all?

推荐答案

LIBCMTD是静态多线程C运行时库的调试版本. MSVCR80D是基于DLL的多线程C运行时库的调试版本.您的一些子项目要求一个,而另一个.这是微软的烂摊子,但您必须处理它.选择一个,例如,多线程调试DLL,并将其专门用于项目和所有子项目的Debug版本.微软的许可证(被告知)要求您对发布的软件使用非调试版本.

LIBCMTD is the debug version of the static multi-threaded C runtime library. MSVCR80D is a debug version of the DLL-based multi-threaded C runtime library. Some of your sub-projects are calling for one, some the other. It's a Microsoft mess, but you have to deal with it. Pick one, say, Multi-threaded debug DLL, and use it exclusively for the Debug version of your project and all sub-projects. The Microsoft license (I am told) requires that you use a non-debug version for released software.

有关更多信息,请参见以下内容:单击.

See the following for more info: CLICK.

这篇关于如何解决Visual Studio中的以下链接器错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆