msvcrt.lib和LIBCD.lib链接冲突

摘要:
今天,当我将一个开源代码移植到WindowsVC6项目时,在编译过程中出现了这些奇怪的LINK错误。

今天在移植一个开源代码到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文件。

msvcrt.lib和LIBCD.lib链接冲突第1张

关于这个选项的更多说明请参考:http://msdn.microsoft.com/en-us/library/70abkas3.aspx

免责声明:文章转载自《msvcrt.lib和LIBCD.lib链接冲突》仅用于学习参考。如对内容有疑问,请及时联系本站处理。

上篇C#中的double类型数据向SQL sqerver 存储与读取问题MySQL InnoDB 存储引擎原理浅析下篇

宿迁高防,2C2G15M,22元/月;香港BGP,2C5G5M,25元/月 雨云优惠码:MjYwNzM=

随便看看

Google Chrome浏览器 浏览器插件 Modify Headers模拟修改IP地

当我们访问一个网站时,一些网站服务器会判断访问该网站的浏览器的标题信息,然后决定如何将网站内容呈现给浏览器。服务器还将基于浏览器头部中包含的其他信息来确定是否向浏览器呈现特定信息。...

小程序真机上报错 for developer: some selectors are not allowed in component wxss , including tag name selectors, id selectors, and attribute selectors

在引用组件的组件和页面中使用后代选择器在某些极端情况下会产生意想不到的性能。如果是,请避免使用它们。子元素选择器只能在视图组件及其子节点之间使用,其他组件可能会导致意外情况。继承的样式(如字体和颜色)将从组件外部继承到组件内部。除了继承样式之外,app.wxss中的样式和组件所在页面的样式对于自定义组件无效。...

Java switch 枚举

Switch可以使用int.short、char、Enum和String其中,Enum是1.5之后的新特性,String是java8的新特性。所以正确的写作应该如下。...

Ubuntu 18.04 安装微信(附企业微信)

Ubuntu软件市场也是有的,所以安全性不用担心开源地址:https://github.com/geeeeeeeeek/electronic-wechat下面介绍几种安装的方式:1.直接解压运行先选择你系统版本:解压一下:tar-zxvfxxx.tar.gz算了,还是简单为新手分析一下==》tar命令可以解包.tar和.tar.gz。为啥我的没有微信图标?...

Winform知识点

BringToFront()将控件移动到Z顺序的前面。...

uni-app为组件uni-icons增加自定义图标(超简单)

1、找到需要的图标,这里我是在阿里巴巴图标库(https://www.iconfont.cn/)中找到对应的图标下载为svg格式备用:2、通过在线ttf编辑器打开uni.ttf文件(http://fontstore.baidu.com/static/editor/index.html#),打开之后可以看到所有的uni所有图标都在里面3、导入第一步下载好的图标...