msvcrt.lib和LIBCD.lib链接冲突
今天在移植一个开源代码到windows的VC6工程,编译时出现了这些奇怪的LINK错误。
++++++++++++++++++++++++
msvcrt.lib(MSVCRT.dll) : error LNK2005: _toupper already defined in LIBCD.lib(toupper.obj)
msvcrt.lib(MSVCRT.dll) : error LNK2005: _tolower already defined in LIBCD.lib(tolower.obj)
msvcrt.lib(MSVCRT.dll) : error LNK2005: _isupper already defined in LIBCD.lib(_ctype.obj)
msvcrt.lib(MSVCRT.dll) : error LNK2005: _isalpha already defined in LIBCD.lib(_ctype.obj)
msvcrt.lib(MSVCRT.dll) : error LNK2005: _free already defined in LIBCD.lib(dbgheap.obj)
msvcrt.lib(MSVCRT.dll) : error LNK2005: _realloc already defined in LIBCD.lib(dbgheap.obj)
msvcrt.lib(MSVCRT.dll) : error LNK2005: _atol already defined in LIBCD.lib(atox.obj)
msvcrt.lib(MSVCRT.dll) : error LNK2005: _malloc already defined in LIBCD.lib(dbgheap.obj)
msvcrt.lib(MSVCRT.dll) : error LNK2005: _wcslen already defined in LIBCD.lib(wcslen.obj)
msvcrt.lib(MSVCRT.dll) : error LNK2005: __strdup already defined in LIBCD.lib(strdup.obj)
msvcrt.lib(MSVCRT.dll) : error LNK2005: _memmove already defined in LIBCD.lib(memmove.obj)
msvcrt.lib(MSVCRT.dll) : error LNK2005: _strrchr already defined in LIBCD.lib(strrchr.obj)
msvcrt.lib(MSVCRT.dll) : error LNK2005: _isspace already defined in LIBCD.lib(_ctype.obj)
msvcrt.lib(MSVCRT.dll) : error LNK2005: _strchr already defined in LIBCD.lib(strchr.obj)
msvcrt.lib(MSVCRT.dll) : error LNK2005: _isalnum already defined in LIBCD.lib(_ctype.obj)
msvcrt.lib(MSVCRT.dll) : error LNK2005: _isdigit already defined in LIBCD.lib(_ctype.obj)
msvcrt.lib(MSVCRT.dll) : error LNK2005: _isxdigit already defined in LIBCD.lib(_ctype.obj)
msvcrt.lib(MSVCRT.dll) : error LNK2005: _strncmp already defined in LIBCD.lib(strncmp.obj)
msvcrt.lib(MSVCRT.dll) : error LNK2005: _localeconv already defined in LIBCD.lib(lconv.obj)
msvcrt.lib(MSVCRT.dll) : error LNK2005: _sprintf already defined in LIBCD.lib(sprintf.obj)
msvcrt.lib(MSVCRT.dll) : error LNK2005: _exit already defined in LIBCD.lib(crt0dat.obj)
msvcrt.lib(MSVCRT.dll) : error LNK2005: _floor already defined in LIBCD.lib(floor.obj)
msvcrt.lib(MSVCRT.dll) : error LNK2005: __stricmp already defined in LIBCD.lib(stricmp.obj)
msvcrt.lib(MSVCRT.dll) : error LNK2005: _getenv already defined in LIBCD.lib(getenv.obj)
msvcrt.lib(MSVCRT.dll) : error LNK2005: _atoi already defined in LIBCD.lib(atox.obj)
msvcrt.lib(MSVCRT.dll) : error LNK2005: _atof already defined in LIBCD.lib(atof.obj)
msvcrt.lib(MSVCRT.dll) : error LNK2005: _fclose already defined in LIBCD.lib(fclose.obj)
msvcrt.lib(MSVCRT.dll) : error LNK2005: _strcspn already defined in LIBCD.lib(strcspn.obj)
msvcrt.lib(MSVCRT.dll) : error LNK2005: _fwrite already defined in LIBCD.lib(fwrite.obj)
msvcrt.lib(MSVCRT.dll) : error LNK2005: _fputc already defined in LIBCD.lib(fputc.obj)
msvcrt.lib(MSVCRT.dll) : error LNK2005: _strtol already defined in LIBCD.lib(strtol.obj)
msvcrt.lib(MSVCRT.dll) : error LNK2005: _strncpy already defined in LIBCD.lib(strncpy.obj)
msvcrt.lib(MSVCRT.dll) : error LNK2005: __isctype already defined in LIBCD.lib(isctype.obj)
msvcrt.lib(MSVCRT.dll) : error LNK2005: __strnicmp already defined in LIBCD.lib(strnicmp.obj)
msvcrt.lib(MSVCRT.dll) : error LNK2005: _strstr already defined in LIBCD.lib(strstr.obj)
msvcrt.lib(MSVCRT.dll) : error LNK2005: _isprint already defined in LIBCD.lib(_ctype.obj)
msvcrt.lib(MSVCRT.dll) : error LNK2005: _strtod already defined in LIBCD.lib(strtod.obj)
msvcrt.lib(MSVCRT.dll) : error LNK2005: _fopen already defined in LIBCD.lib(fopen.obj)
msvcrt.lib(MSVCRT.dll) : error LNK2005: _fflush already defined in LIBCD.lib(fflush.obj)
msvcrt.lib(MSVCRT.dll) : error LNK2005: _calloc already defined in LIBCD.lib(dbgheap.obj)
msvcrt.lib(MSVCRT.dll) : error LNK2005: _abort already defined in LIBCD.lib(abort.obj)
msvcrt.lib(MSVCRT.dll) : error LNK2005: _islower already defined in LIBCD.lib(_ctype.obj)
++++++++++++++++++++++++
从提示来看,msvcrt.lib(MSVCRT.dll)和LIBCD.lib中存在符号冲突!
导致链接器在链接时发现一个符号在两处有定义,就不知道该链接那个了,从而报出LNK2005的链接错误。
在工程设置中勾上"Force file output"即可强制生成dll或exe文件。
关于这个选项的更多说明请参考:http://msdn.microsoft.com/en-us/library/70abkas3.aspx
转载于:https://www.cnblogs.com/kekec/archive/2011/11/18/2253879.html
msvcrt.lib和LIBCD.lib链接冲突相关推荐
- nafxcw.lib与LIBCMT.lib在vs2008中链接冲突解决方案
1>正在链接... 1>nafxcw.lib(afxmem.obj) : error LNK2005: "void * __cdecl operator new(unsigned ...
- libcmt.lib和libcmtd.lib链接库冲突错误的解决方案
在同一个项目中,所有的源文件必须链接相同的C运行时库.如果某一文件用了Multithreaded DLL版本,而其他文件用了Single-Threaded或者Multithreaded版本的库,也就是 ...
- LINK : fatal error LNK1104: 无法打开文件“LIBCD.lib”
出现这类问题一般是由于所运行的项目是VC6(或者vs2003)创建的,而后又用VS2005或者更高版本工具打开项目导致的,原因都是因为LIBCD.lib文件被更改了.要解决问题的话,只要在链接设置那里 ...
- LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol
学习VC++时经常会遇到链接错误LNK2001,而一般说来发生连接错误时,编译都已通过.产生连接错误的原因非常多,尤其LNK2001错误,常常使人不明其所以然.产生LNK2001错误的原因:一个是由于 ...
- LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol(转)
LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol(转) 学习VC++时经常会遇到链接错误LNK2001,而一般说来发 ...
- 动态链接库dll,静态链接库lib, 导入库lib
目前以lib后缀的库有两种,一种为静态链接库(Static Libary,以下简称"静态库"),另一种为动态连接库(DLL,以下简称"动态库")的导入库(Imp ...
- 动态链接库dll,静态链接库lib, 导入库lib 转
动态链接库dll,静态链接库lib, 导入库lib 在用VS编译工程的时候,我们会选择动态链接库dll,静态链接库lib(static library),可是为什么在编译动态链接库的时候也可以指定输出 ...
- 使用VS开发C++ 控制台程序或其他项目出现 ‘ LINK : fatal error LNK1104: 无法打开文件“LIBCD.lib” ’ 常规解决办法
原因:大多是由低版本例如VC6(本人是)开发项目,然后在高版本上再开发该项目导致LIBCD.lib出现更改由此出现错误提示. 本人VS版本2017: 一般解决办法: 第一步:右键项目属性 第二步:在忽 ...
- atlsd.lib 和 atls.lib冲突
2019独角兽企业重金招聘Python工程师标准>>> atlsd.lib 和 atls.lib冲突: 原因:当前工程中有debug和release两种形式的atls.lib库,可能 ...
最新文章
- STM32F407的时钟配置
- 多线程的两种实现方式和区别?
- jdk1.8新特性(五)——Stream
- 树莓派4B (aarch64) 安装PyTorch 1.8 的可行方案
- 界面设计方法 (2) — 3.卡式, 列表, 主细表, 树形, 页签
- 浅谈5000万:外挂,代理与卡盟的故事。
- P1563 [NOIP2016 提高组] 玩具谜题
- Java基础面试题整理-50题(附答案)
- php 读取 日文文件名,PHP文件上传-处理阿拉伯文/中文/日文文件名
- 记录一下java的常用单词
- Microsoft System Center (SCCM/SCOM)简介
- three.js绘制墙体,通过不规则路径生成墙体,3D墙体绘制
- 互联网突破和 SD-WAN
- (zz)linux awk
- SpringBoot中报错expected at least 1 bean which qualifies as autowire candidate. Dependency annotations:
- https访问http接口处理
- EventBus 3.0 事件公交车
- Python开发系列课程(11) - 面向对象编程进阶
- 区块链之联盟链---认识Fabric
- 第六章函数,编写一个判断水仙花数的函数,从主函数输入正整数n,在主函数中调用判断水仙花数的函数,找出n以内所有的水仙花数。(水仙花数指3位数的各个数字的立方和等于这个三位数本身)。