`

LIBCD.lib(crt0dat.obj) : error LNK2005: _exit already defined in msvcrtd.lib(MSV

    博客分类:
  • c++
 
阅读更多
LIBCD.lib(crt0dat.obj) : error LNK2005: _exit already defined in msvcrtd.lib(MSVCRTD.dll)
LIBCD.lib(crt0dat.obj) : error LNK2005: __exit already defined in msvcrtd.lib(MSVCRTD.dll)
LIBCD.lib(dbgheap.obj) : error LNK2005: _malloc already defined in msvcrtd.lib(MSVCRTD.dll)
LIBCD.lib(dbgheap.obj) : error LNK2005: _calloc already defined in msvcrtd.lib(MSVCRTD.dll)
LIBCD.lib(dbgheap.obj) : error LNK2005: _realloc already defined in msvcrtd.lib(MSVCRTD.dll)
LIBCD.lib(dbgheap.obj) : error LNK2005: _free already defined in msvcrtd.lib(MSVCRTD.dll)
LIBCD.lib(crt0init.obj) : error LNK2005: ___xc_z already defined in msvcrtd.lib(cinitexe.obj)
LIBCD.lib(crt0init.obj) : error LNK2005: ___xc_a already defined in msvcrtd.lib(cinitexe.obj)
LIBCD.lib(crt0init.obj) : error LNK2005: ___xi_z already defined in msvcrtd.lib(cinitexe.obj)
LIBCD.lib(crt0init.obj) : error LNK2005: ___xi_a already defined in msvcrtd.lib(cinitexe.obj)
LIBCD.lib(mbctype.obj) : error LNK2005: __getmbcp already defined in msvcrtd.lib(MSVCRTD.dll)
LIBCD.lib(winxfltr.obj) : error LNK2005: __XcptFilter already defined in msvcrtd.lib(MSVCRTD.dll)
msvcrtd.lib(MSVCRTD.dll) : error LNK2005: __setmbcp already defined in LIBCD.lib(mbctype.obj)
LIBCD.lib(crt0dat.obj) : warning LNK4006: _exit already defined in msvcrtd.lib(MSVCRTD.dll); second definition ignored
LIBCD.lib(crt0dat.obj) : warning LNK4006: __exit already defined in msvcrtd.lib(MSVCRTD.dll); second definition ignored
LIBCD.lib(dbgheap.obj) : warning LNK4006: _malloc already defined in msvcrtd.lib(MSVCRTD.dll); second definition ignored
LIBCD.lib(dbgheap.obj) : warning LNK4006: _calloc already defined in msvcrtd.lib(MSVCRTD.dll); second definition ignored
LIBCD.lib(dbgheap.obj) : warning LNK4006: _realloc already defined in msvcrtd.lib(MSVCRTD.dll); second definition ignored
LIBCD.lib(dbgheap.obj) : warning LNK4006: _free already defined in msvcrtd.lib(MSVCRTD.dll); second definition ignored
LIBCD.lib(crt0init.obj) : warning LNK4006: ___xc_z already defined in msvcrtd.lib(cinitexe.obj); second definition ignored
LIBCD.lib(crt0init.obj) : warning LNK4006: ___xc_a already defined in msvcrtd.lib(cinitexe.obj); second definition ignored
LIBCD.lib(crt0init.obj) : warning LNK4006: ___xi_z already defined in msvcrtd.lib(cinitexe.obj); second definition ignored
LIBCD.lib(crt0init.obj) : warning LNK4006: ___xi_a already defined in msvcrtd.lib(cinitexe.obj); second definition ignored
LIBCD.lib(mbctype.obj) : warning LNK4006: __getmbcp already defined in msvcrtd.lib(MSVCRTD.dll); second definition ignored
LIBCD.lib(winxfltr.obj) : warning LNK4006: __XcptFilter already defined in msvcrtd.lib(MSVCRTD.dll); second definition ignored
msvcrtd.lib(MSVCRTD.dll) : warning LNK4006: __setmbcp already defined in LIBCD.lib(mbctype.obj); second definition ignored
   Creating library Debug/APathFindTest.lib and object Debug/APathFindTest.exp
LINK : warning LNK4098: defaultlib "msvcrtd.lib" conflicts with use of other libs; use /NODEFAULTLIB:library
LINK : warning LNK4098: defaultlib "LIBCD" conflicts with use of other libs; use /NODEFAULTLIB:library
Debug/APathFindTest.exe : fatal error LNK1169: one or more multiply defined symbols found
Error executing link.exe.

原因与修改办法:

默认的"libcmtd.lib"和其他的一些libs有冲突,可以用/NODEFAULTLIB:library设置屏蔽掉默认的 libcmtd.lib。

在Project中打开Project Setting设置对话框,选择Link选中Category旁边下拉框的Input项。

在Ignore Libraries下面输入libcmtd.lib,将此屏蔽。

回过头来,原来我的程序是USE mfc  in a share dll, 而libcmtd.lib是静态 C runtime库,所以应该屏蔽掉libcmtd.lib,以免造成冲突。
分享到:
评论

相关推荐

    error LNK2005: DllMain already defined in corelibc.lib(dllmain.obj)

    error LNK2005: DllMain already defined in corelibc.lib(dllmain.obj)的解决方案

    使用CxImage实现图像格式转换.pdf

    LIBCMT.lib(crt0dat.obj) : error LNK2005: _exit already defined in MSVCRTD.lib(MSVCR100D.dll) LIBCMT.lib(crt0dat.obj) : error LNK2005: __amsg_exit already defined in MSVCRTD.lib(MSVCR100D.dll) LIBCMT....

    VS2012中使用SQLite3出现中重定义解决办法

    1>msvcrtd.lib(ti_inst.obj) : error LNK2005: "private: class type_info & __thiscall type_info::operator=(class type_info const &)" (??4type_info@@AAEAAV0@ABV0@@Z) 已经在 libcmtd.lib(typinfo.obj) 中定义...

    uafxcwd.lib LIBCMTD.lib 弱外部链接

    uafxcwd.lib(afxmem.obj) : error LNK2005: "void * __cdecl operator new(unsigned int)" (??2@YAPAXI@Z) already defined in LIBCMTD.lib(new.obj) uafxcwd.lib(afxmem.obj) : error LNK2005: "void __cdecl ...

    VC++常见安装调试错误

    LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16 msvcrtd.lib(crtexew.obj) : error LNK2001: unresolved external symbol _WinMain@16 nafxcwd.lib(thrdcore.obj) : error LNK...

    C++经典错误之already defined in *****.obj解决方法

    否则,链接时就会出现“error LNK2005:…… already defined in”错误! 这是一种专门针对MFC程序的解决方案,即在定义类时,如果成员函数放在类定义外,需要加上“inline”关键字,以避免符号的重复定义。 2. ...

    最新libcurl静态库

    如果出现以下错误: ...1>libcurld.lib(openssl.obj) : error LNK2019: 无法解析的外部符号 _sk_num,该符号在函数 _cert_stuff 中被引用 ............... 则应添加对 ssleay32.lib 和 libeay32.lib 的引用

    error LNK1104 无法打开文件opencv_core245d.lib

    在使用不同版本opencv时,编译器有时会报错,error LNK1104 无法打开文件opencv_core245d.lib,本文给出了详细的解决方法,实测有效

    UAFXCWD.LIB和UAFXCWD.PDB库文件.rar

    2@YAPAXI@Z) already defined in LIBCMTD.lib(new.obj) nafxcwd.lib(afxmem.obj) : error LNK2005: "void __cdecl operator delete(void *)" (??3@YAXPAX@Z) already defined in LIBCMTD.lib(dbgdel.obj) Debug/DCap...

    无法解析的外部符号”private: char * __cdecl cv::String::allocate(unsigned __int64)” (?allocate@String@cv@@AEAA

    1>save-image-D435.obj : error LNK2001: 无法解析的外部符号 “private: char * __cdecl cv::String::allocate(unsigned __int64)” (?allocate@String@cv@@AEAAPEAD_K@Z) 1>save-image-D435.obj : error LNK2001: ...

    提示出现unresolved external symbol _main的解决方法

    libcmtd.lib(crt0.obj) : error LNK2001: unresolved external symbol _main LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16 msvcrtd.lib(crt

    odbccp32.lib.rar

    vs2010或vs2015等项目编译不通过,提示:1>odbccp32.lib(dllload.obj) : error LNK2019: 无法解析的外部符号 __vsnwprintf_s,该符号在函数 _StringCchPrintfW 中被引用 1>XuglassForm.exe : fatal error LNK1120: 1...

    mfc与其他库冲突问题.doc

    mfcs40d.lib(dllmodul.obj):error LNK2005: _DllMain@12 already defined in MSVCRTD.LIB (dllmain.obj) mfcs42d.lib(dllmodul.obj):error LNK2005: _DllMain@12 already defined in msvcrtd.lib(dllmain.obj) ``` ...

    VC6.0常见链接错误与解决方法

    (2)error LNK2005: _main already defined in xxxx.obj 编号:LNK2005 直译:_main已经存在于xxxx.obj中了。 错误分析: 直接的原因是该程序中有多个(不止一个)main函数。这是初学C++的低年级同学在初次编程时经常...

    关于vc6.0连接时的LIBCD.lib问题

    libcmtd.lib(crt0.obj):errorLNK2001: unresolved external symbol _main ``` **解决方案:** 1. 通过`Project` > `Settings`打开项目设置对话框。 2. 在“Link”选项卡下的“Project Options”区域,将`/...

    odbccp32出现版本错误的解决方法

    ODBCCP32.dll是微软ODBC(Open Database Connectivity)的一部分,它是一个数据库连接库,用于在Windows操作系统中实现应用程序与各种数据库之间的通信。当您遇到"odbccp32出现版本错误"的问题时,这通常意味着当前...

    libucrt.lib、libucrtd.lib、ucrt.lib、ucrtd.lib文件

    VS报错:fatal error LNK1104: 无法打开文件“ucrtd.lib”解决办法,将文件复制后粘贴在相应位置,便可解决问题。具体方法见以下链接:https://blog.csdn.net/qq_43297971/article/details/121170313

    VS2012中QT5.1自定plugin及动态加载plugin

    在本文中,我们将深入探讨如何在Visual Studio 2012 (VS2012)环境中,使用QT 5.1框架开发自定义插件,并实现动态加载这些插件。这个过程涉及到的主要知识点包括QT插件机制、插件接口设计、VS2012与QT的集成以及动态...

    易语言静态编译连接工具

    易语言静态编译连接工具是一种专门用于易语言编程环境的工具,它允许程序员将源代码编译成独立的可执行文件,无需依赖任何外部库或框架。在IT行业中,静态编译是一种重要的编译方式,它与动态编译相对应,具有独特的...

Global site tag (gtag.js) - Google Analytics