zoukankan      html  css  js  c++  java
  • LNK2005 *** 已经在 *** lib中定义

    调试程序的时候下面的错误是经常遇到的,也是很吓人,其实这主要是在vs2005中调用vc6生成的lib或者dll时遇到

     1 1>LIBCMT.lib(setlocal.obj) : error LNK2005: __configthreadlocale 已经在 msvcrtd.lib(MSVCR80D.dll) 中定义
     2 1>LIBCMT.lib(tidtable.obj) : error LNK2005: __encode_pointer 已经在 msvcrtd.lib(MSVCR80D.dll) 中定义
     3 1>LIBCMT.lib(tidtable.obj) : error LNK2005: __decode_pointer 已经在 msvcrtd.lib(MSVCR80D.dll) 中定义
     4 1>LIBCMT.lib(invarg.obj) : error LNK2005: __invoke_watson 已经在 msvcrtd.lib(MSVCR80D.dll) 中定义
     5 1>LIBCMT.lib(crt0dat.obj) : error LNK2005: __amsg_exit 已经在 msvcrtd.lib(MSVCR80D.dll) 中定义
     6 1>LIBCMT.lib(crt0dat.obj) : error LNK2005: __initterm_e 已经在 msvcrtd.lib(MSVCR80D.dll) 中定义
     7 1>LIBCMT.lib(crt0dat.obj) : error LNK2005: _exit 已经在 msvcrtd.lib(MSVCR80D.dll) 中定义
     8 1>LIBCMT.lib(crt0dat.obj) : error LNK2005: __exit 已经在 msvcrtd.lib(MSVCR80D.dll) 中定义
     9 1>LIBCMT.lib(crt0dat.obj) : error LNK2005: __cexit 已经在 msvcrtd.lib(MSVCR80D.dll) 中定义
    10 1>LIBCMT.lib(mlock.obj) : error LNK2005: __unlock 已经在 msvcrtd.lib(MSVCR80D.dll) 中定义
    11 1>LIBCMT.lib(mlock.obj) : error LNK2005: __lock 已经在 msvcrtd.lib(MSVCR80D.dll) 中定义
    12 1>LIBCMT.lib(winxfltr.obj) : error LNK2005: __XcptFilter 已经在 msvcrtd.lib(MSVCR80D.dll) 中定义
    13 1>LIBCMT.lib(calloc.obj) : error LNK2005: _calloc 已经在 msvcrtd.lib(MSVCR80D.dll) 中定义
    14 1>LIBCMT.lib(realloc.obj) : error LNK2005: __recalloc 已经在 msvcrtd.lib(MSVCR80D.dll) 中定义
    15 1>LIBCMT.lib(crt0init.obj) : error LNK2005: ___xi_a 已经在 msvcrtd.lib(cinitexe.obj) 中定义
    16 1>LIBCMT.lib(crt0init.obj) : error LNK2005: ___xi_z 已经在 msvcrtd.lib(cinitexe.obj) 中定义
    17 1>LIBCMT.lib(crt0init.obj) : error LNK2005: ___xc_a 已经在 msvcrtd.lib(cinitexe.obj) 中定义
    18 1>LIBCMT.lib(crt0init.obj) : error LNK2005: ___xc_z 已经在 msvcrtd.lib(cinitexe.obj) 中定义
    19 1>LIBCMT.lib(hooks.obj) : error LNK2005: "void __cdecl terminate(void)" (?terminate@@YAXXZ) 已经在 msvcrtd.lib(MSVCR80D.dll) 中定义
    20 1>LIBCMT.lib(dosmap.obj) : error LNK2005: __errno 已经在 msvcrtd.lib(MSVCR80D.dll) 中定义
    21 1>LIBCMT.lib(errmode.obj) : error LNK2005: ___set_app_type 已经在 msvcrtd.lib(MSVCR80D.dll) 中定义
    22 1>msvcrtd.lib(MSVCR80D.dll) : error LNK2005: __setmbcp 已经在 LIBCMT.lib(mbctype.obj) 中定义
    23 1>LINK : warning LNK4098: 默认库“msvcrtd.lib”与其他库的使用冲突;请使用 /NODEFAULTLIB:library
    24 1>LINK : warning LNK4098: 默认库“LIBCMT”与其他库的使用冲突;请使用 /NODEFAULTLIB:library
    25 1>LIBCMT.lib(crt0.obj) : error LNK2019: 无法解析的外部符号 _main,该符号在函数 ___tmainCRTStartup 中被引用

    其实仔细观察还是可以解决的,如下:


    链接器->输入->忽略特定库: libcmt.lib

  • 相关阅读:
    [转]mysql视图学习总结
    [转]mysql索引详解
    mysql索引的操作
    [转]mysql的约束
    mysql表的操作
    【转】mysql的数据类型
    java泛型
    java 8新特性
    Dubbo有意思的特性介绍
    dubbo + zookeeper
  • 原文地址:https://www.cnblogs.com/rainbowzc/p/1767248.html
Copyright © 2011-2022 走看看