zoukankan      html  css  js  c++  java
  • libcmt.lib(crt0dat.obj) : error LNK2005: _amsg_exit 已经在 MSVCRTD.lib(MSVCR110D.dll) 中定义

    问题描述(VC2012):

    1>MSVCRTD.lib(cinitexe.obj) : warning LNK4098: 默认库“libcmt.lib”与其他库的使用冲突;请使用 /NODEFAULTLIB:library

    1>  正在生成代码
    1>  已完成代码的生成
    1>libcmt.lib(crt0dat.obj) : error LNK2005: _amsg_exit 已经在 MSVCRTD.lib(MSVCR110D.dll) 中定义
    1>libcmt.lib(crt0dat.obj) : error LNK2005: _initterm_e 已经在 MSVCRTD.lib(MSVCR110D.dll) 中定义
    1>libcmt.lib(vsnprint.obj) : error LNK2005: _vsnprintf 已经在 MSVCRTD.lib(MSVCR110D.dll) 中定义
    1>libcmt.lib(winapisupp.obj) : error LNK2005: __crtCaptureCurrentContext 已经在 MSVCRTD.lib(MSVCR110D.dll) 中定义
    1>libcmt.lib(winapisupp.obj) : error LNK2005: __crtCapturePreviousContext 已经在 MSVCRTD.lib(MSVCR110D.dll) 中定义
    1>libcmt.lib(winapisupp.obj) : error LNK2005: __crtTerminateProcess 已经在 MSVCRTD.lib(MSVCR110D.dll) 中定义
    1>libcmt.lib(winapisupp.obj) : error LNK2005: __crtUnhandledException 已经在 MSVCRTD.lib(MSVCR110D.dll) 中定义
    1>libcmt.lib(hooks.obj) : error LNK2005: "void __cdecl terminate(void)" (?terminate@@YAXXZ) 已经在 MSVCRTD.lib(MSVCR110D.dll) 中定义
    1>libcmt.lib(crt0init.obj) : error LNK2005: __xi_a 已经在 MSVCRTD.lib(cinitexe.obj) 中定义
    1>libcmt.lib(crt0init.obj) : error LNK2005: __xi_z 已经在 MSVCRTD.lib(cinitexe.obj) 中定义
    1>libcmt.lib(crt0init.obj) : error LNK2005: __xc_a 已经在 MSVCRTD.lib(cinitexe.obj) 中定义
    1>libcmt.lib(crt0init.obj) : error LNK2005: __xc_z 已经在 MSVCRTD.lib(cinitexe.obj) 中定义
    1>libcmt.lib(winxfltr.obj) : error LNK2005: __CppXcptFilter 已经在 MSVCRTD.lib(MSVCR110D.dll) 中定义
    1>libcmt.lib(mlock.obj) : error LNK2005: _lock 已经在 MSVCRTD.lib(MSVCR110D.dll) 中定义
    1>libcmt.lib(mlock.obj) : error LNK2005: _unlock 已经在 MSVCRTD.lib(MSVCR110D.dll) 中定义

    1>MSVCRTD.lib(MSVCR110D.dll) : error LNK2005: _wcsicmp 已经在 libcmt.lib(wcsicmp.obj) 中定义


    解决办法:

    其实问题的解决办法编译器已经提出来了:

    1>MSVCRTD.lib(cinitexe.obj) : warning LNK4098: 默认库“libcmt.lib”与其他库的使用冲突;请使用 /NODEFAULTLIB:library


    所以把libcmt.lib加入到忽略库中就行了,本人的是VC2012,具体如图





  • 相关阅读:
    【Repost】Comparision of B-Tree and LSM Tree
    字符串经典算法 Knuth-Morris-Pratt Boyer-Moore AC(Aho-Corasick)算法 后缀自动机
    【Leetcode 913】【Hard】Cat and Mouse 博弈论
    【转】初探计算机视觉的三个源头、兼谈人工智能
    MySQL--06(索引)
    MySQL--05(子查询&视图)
    MySQL--04(聚合函数&表连接查询)
    MySQL--03(增删改查&主键)
    MySQL--02
    MySQL--01
  • 原文地址:https://www.cnblogs.com/vcerror/p/4289020.html
Copyright © 2011-2022 走看看