LIBCMT.lib(crt0dat.obj) : error LNK2005 错误的解决方法
2014-05-14 11:27
531 查看
LIBCMT.lib(crt0dat.obj) : error LNK2005: _exit already defined in msvcrt.lib(MSVCRT.dll)
LIBCMT.lib(crt0dat.obj) : error LNK2005: __exit already defined in msvcrt.lib(MSVCRT.dll)
LIBCMT.lib(crt0init.obj) : error LNK2005: ___xc_z already defined in msvcrt.lib(cinitexe.obj)
LIBCMT.lib(crt0init.obj) : error LNK2005: ___xc_a already defined in msvcrt.lib(cinitexe.obj)
LIBCMT.lib(crt0init.obj) : error LNK2005: ___xi_z already defined in msvcrt.lib(cinitexe.obj)
LIBCMT.lib(crt0init.obj) : error LNK2005: ___xi_a already defined in msvcrt.lib(cinitexe.obj)
LIBCMT.lib(winxfltr.obj) : error LNK2005: __XcptFilter already defined in msvcrt.lib(MSVCRT.dll)
LINK : warning LNK4098: defaultlib "msvcrt.lib" conflicts with use of other libs; use /NODEFAULTLIB:library
LINK : warning LNK4098: defaultlib "LIBCMT" conflicts with use of other libs; use /NODEFAULTLIB:library
LIBCMT.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Release/数据库端.exe : fatal error LNK1120: 1 unresolved externals
执行 link.exe 时出错.
后来经上网查询,得到了解决方法。
涉及到多线程编程。若使用到动态库时,没有问题。用静态库,由于lib冲突,会出现编译错误。
1.使用静态库链接,或不用
2.设置-》c/c++->分类(code generation)->use run time library(选择MD,若是debug选择DMD)
3.在设置-》c/c++->分类(常规)-》预处理定义里加入 ,_AFXDLL
文章来源:http://hi.baidu.com/tracy_2008/item/907f3a173e4b91fd756a849a
相关文章推荐
- libcmtd.lib(crt0dat.obj) : error LNK2005: _exit already defined in msvcrtd.lib(MSVCRTD.dll) 编译错误解决方法
- libcmtd.lib(crt0dat.obj) : error LNK2005: _exit already defined in msvcrtd.lib(MSVCRTD.dll) 编译错误解决方法
- libcmt.lib(crt0dat.obj) : error LNK2005: _amsg_exit 已经在 MSVCRTD.lib(MSVCR110D.dll) 中定义
- error LNK2005: __c_exit already defined in libcmt.lib(crt0dat.obj)
- libcmt.lib(crt0dat.obj) : error LNK2005: _amsg_exit 已经在 MSVCRTD.lib(MSVCR110D.dll) 中定义
- VS2008(VC6)出现如下链接错误的解决方法uafxcwd.lib(afxmem.obj) : error LNK2005: "void * __cdecl operator new(unsign
- 调试错误的解决:error LNK2005: "void * __cdecl operator new(unsigned int)" (??2@YAPAXI@Z) 已经在 LIBCMT.lib(new.obj) 中定义
- VS2005(VC6)出现如下链接错误的解决方法uafxcwd.lib(afxmem.obj) : error LNK2005: "void * __cdecl operator new(unsign
- VS2008(VC6)出现如下链接错误的解决方法uafxcwd.lib(afxmem.obj) : error LNK2005: "void * __cdecl operator new(unsign
- 使用Tinyxml.lib链接出错问题解决 (LIBCMT.lib(sprintf.obj) : error LNK2005: _sprintf_s 已经在 msvcrtd.lib(MSVCR80D.dll) 中定义)
- VC编译错误:uafxcw.lib(afxmem.obj) : error LNK2005: "void * __cdecl operator new(unsigned int)" (??2@YAPAXI@Z) 已经在 LIBCMT.lib(new.obj
- libcd.lib(crt0dat.obj) : error LNK2005: _exit already defined in msvcrtd.lib(MSVCRTD.dll)
- uafxcwd.lib(afxmem.obj) : error LNK2005 解决方法
- 调试错误的解决:error LNK2005: "void * __cdecl operator new(unsigned int)" (??2@YAPAXI@Z) 已经在 LIBCMT.lib(new
- 使用Tinyxml.lib链接出错问题解决 (LIBCMT.lib(sprintf.obj) : error LNK2005: _sprintf_s 已经在 msvcrtd.lib(MSVCR80D.dll) 中定义)
- 调试错误的解决:error LNK2005: "void * __cdecl operator new(unsigned int)" (??2@YAPAXI@Z) 已经在 LIBCMT.lib(ne
- (转+原)VC编译错误:uafxcw.lib(afxmem.obj) : error LNK2005: "void * __cdecl operator new(unsigned int)" (??2@YAPAXI@Z) 已经在 LIBCMT.lib(new.obj) 中定义
- 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)
- 调试错误的解决:error LNK2005: "void * __cdecl operator new(unsigned int)" (??2@YAPAXI@Z) 已经在 LIBCMT.lib(ne