博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
编译错误"MSVCRTD.lib(MSVCRTD.dll):errorLNK200
阅读量:6548 次
发布时间:2019-06-24

本文共 4791 字,大约阅读时间需要 15 分钟。

 
今天在编译vc工程时出现的错误,并在网上找到了解决方法,有类似问题的请参照
本人在编译VC6.0工程时,遇到如下错误:
MSVCRTD.lib(MSVCRTD.dll)   :   error   LNK2005:   _getenv   already   defined   in   LIBCMTD.lib(getenv.obj)
MSVCRTD.lib(MSVCRTD.dll)   :   error   LNK2005:   _free   already   defined   in   LIBCMTD.lib(dbgheap.obj)
MSVCRTD.lib(MSVCRTD.dll)   :   error   LNK2005:   _calloc   already   defined   in   LIBCMTD.lib(dbgheap.obj)
MSVCRTD.lib(MSVCRTD.dll)   :   error   LNK2005:   _malloc   already   defined   in   LIBCMTD.lib(dbgheap.obj)
MSVCRTD.lib(MSVCRTD.dll)   :   error   LNK2005:   _printf   already   defined   in   xlibgui.lib(PRINTF.OBJ)
MSVCRTD.lib(MSVCRTD.dll)   :   error   LNK2005:   _fflush   already   defined   in   LIBCMTD.lib(fflush.obj)
MSVCRTD.lib(MSVCRTD.dll)   :   error   LNK2005:   _sprintf   already   defined   in   LIBCMTD.lib(sprintf.obj)
MSVCRTD.lib(MSVCRTD.dll)   :   error   LNK2005:   _strncpy   already   defined   in   LIBCMTD.lib(strncpy.obj)
MSVCRTD.lib(MSVCRTD.dll)   :   error   LNK2005:   _atoi   already   defined   in   LIBCMTD.lib(atox.obj)
MSVCRTD.lib(MSVCRTD.dll)   :   error   LNK2005:   _realloc   already   defined   in   LIBCMTD.lib(dbgheap.obj)
MSVCRTD.lib(MSVCRTD.dll)   :   error   LNK2005:   _signal   already   defined   in   LIBCMTD.lib(winsig.obj)
MSVCRTD.lib(MSVCRTD.dll)   :   error   LNK2005:   __controlfp   already   defined   in   LIBCMTD.lib(ieee87.obj)
MSVCRTD.lib(MSVCRTD.dll)   :   error   LNK2005:   _exit   already   defined   in   LIBCMTD.lib(crt0dat.obj)
MSVCRTD.lib(MSVCRTD.dll)   :   warning   LNK4006:   _getenv   already   defined   in   LIBCMTD.lib(getenv.obj);   second   definition   ignored
MSVCRTD.lib(MSVCRTD.dll)   :   warning   LNK4006:   _free   already   defined   in   LIBCMTD.lib(dbgheap.obj);   second   definition   ignored
MSVCRTD.lib(MSVCRTD.dll)   :   warning   LNK4006:   _calloc   already   defined   in   LIBCMTD.lib(dbgheap.obj);   second   definition   ignored
MSVCRTD.lib(MSVCRTD.dll)   :   warning   LNK4006:   _malloc   already   defined   in   LIBCMTD.lib(dbgheap.obj);   second   definition   ignored
MSVCRTD.lib(MSVCRTD.dll)   :   warning   LNK4006:   _printf   already   defined   in   xlibgui.lib(PRINTF.OBJ);   second   definition   ignored
MSVCRTD.lib(MSVCRTD.dll)   :   warning   LNK4006:   _fflush   already   defined   in   LIBCMTD.lib(fflush.obj);   second   definition   ignored
MSVCRTD.lib(MSVCRTD.dll)   :   warning   LNK4006:   _sprintf   already   defined   in   LIBCMTD.lib(sprintf.obj);   second   definition   ignored
MSVCRTD.lib(MSVCRTD.dll)   :   warning   LNK4006:   _strncpy   already   defined   in   LIBCMTD.lib(strncpy.obj);   second   definition   ignored
MSVCRTD.lib(MSVCRTD.dll)   :   warning   LNK4006:   _atoi   already   defined   in   LIBCMTD.lib(atox.obj);   second   definition   ignored
MSVCRTD.lib(MSVCRTD.dll)   :   warning   LNK4006:   _realloc   already   defined   in   LIBCMTD.lib(dbgheap.obj);   second   definition   ignored
MSVCRTD.lib(MSVCRTD.dll)   :   warning   LNK4006:   _signal   already   defined   in   LIBCMTD.lib(winsig.obj);   second   definition   ignored
MSVCRTD.lib(MSVCRTD.dll)   :   warning   LNK4006:   __controlfp   already   defined   in   LIBCMTD.lib(ieee87.obj);   second   definition   ignored
MSVCRTD.lib(MSVCRTD.dll)   :   warning   LNK4006:   _exit   already   defined   in   LIBCMTD.lib(crt0dat.obj);   second   definition   ignored
MSVCRTD.lib(MSVCRTD.dll)   :   warning   LNK4006:   _fclose   already   defined   in   LIBCMTD.lib(fclose.obj);   second   definition   ignored
MSVCRTD.lib(MSVCRTD.dll)   :   warning   LNK4006:   _fopen   already   defined   in   LIBCMTD.lib(fopen.obj);   second   definition   ignored
MSVCRTD.lib(MSVCRTD.dll)   :   warning   LNK4006:   __stricmp   already   defined   in   LIBCMTD.lib(stricmp.obj);   second   definition   ignored
MSVCRTD.lib(MSVCRTD.dll)   :   warning   LNK4006:   _fprintf   already   defined   in   LIBCMTD.lib(fprintf.obj);   second   definition   ignored
MSVCRTD.lib(MSVCRTD.dll)   :   warning   LNK4006:   _ceil   already   defined   in   LIBCMTD.lib(ceil.obj);   second   definition   ignored
      Creating   library   Debug/shm_ext_sim.lib   and   object   Debug/shm_ext_sim.exp
LINK   :   warning   LNK4098:   defaultlib   "MSVCRTD"   conflicts   with   use   of   other   libs;   use   /NODEFAULTLIB:library
LINK   :   warning   LNK4098:   defaultlib   "MSVCRT"   conflicts   with   use   of   other   libs;   use   /NODEFAULTLIB:library
Debug/shm_ext_sim.exe   :   fatal   error   LNK1169:   one   or   more   multiply   defined   symbols   found
Error   executing   link.exe.
shm_ext_sim.exe   -   37   error(s),   86   warning(s)
 
 
原因及解决方法:
主程序和lib所使用的运行库不一致,project->setting-> Generation->Use MFC Static Library
网友:本站网友 时间:2006-08-27 14:24:11 IP地址:202.194.210.
For example, if you received this warning and you want to create an executable file that uses the non-debug, single-threaded version of the run-time libraries, you could use the following options with the linker: 
/NODEFAULTLIB:libcmt.lib /NODEFAULTLIB:msvcrt.lib /NODEFAULTLIB:libcd.lib /NODEFAULTLIB:libcmtd.lib /NODEFAULTLIB:msvcrtd.lib 
或者这样:For example, if you received this warning and you want to create an executable file that uses the non-debug, single-threaded version of the run-time libraries, you could use the following options with the linker:
/NODEFAULTLIB:libcmt.lib /NODEFAULTLIB:msvcrt.lib /NODEFAULTLIB:libcd.lib /NODEFAULTLIB:libcmtd.lib /NODEFAULTLIB写程序看到 warning,感觉不爽。 这个警告在 link option 中 加入 对应的 /NODEFAULTLIB:xxx.lib   就ok了

转载地址:http://sxgdo.baihongyu.com/

你可能感兴趣的文章
php-excel-reader - 简单的excel 读取类
查看>>
ubuntu 在lnmp中php安装GD库
查看>>
Python学习笔记 1
查看>>
mysql 优化方案
查看>>
appium的坑
查看>>
500 Lines or Less
查看>>
函数与指针
查看>>
有关ubuntu的c++开发环境配置
查看>>
【spring】1.spring ioc原理和demo
查看>>
【安全牛学习笔记】ACUNETIX WEB VULNERABILITY SCANNER
查看>>
IOS 静态库制作一 (xxxxx.a)
查看>>
解析JS运动
查看>>
Linux学习笔记第六周第五次课(3月16日)
查看>>
Freemarker+IText生成pdf文件
查看>>
快速排序
查看>>
高清6分钟看完《指环王》三部曲
查看>>
NGINX 负载均衡 之九
查看>>
Ubuntu添加硬盘实验
查看>>
STP生成树协议的工作过程
查看>>
UI标签库专题十:JEECG智能开发平台 Form(form标签)
查看>>