zoukankan      html  css  js  c++  java
  • 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

  • 相关阅读:
    C# 文件操作
    Wpf ListView展示风格
    PowerShell->>获取本地计算机的用户组和组成员
    MySQL->>innodb_autoinc_lock_mode参数控制auto_increment 插入数据时相关锁的模式
    SQL Server ->> 使用CROSS APPLY语句是遇到聚合函数中包含外部引用列时报错
    【转】Kettle发送邮件步骤遇到附件名是中文名变成乱码的问题解决办法
    SSIS ->> Excel Destination无法接受大于255个字符长度的字符字段
    SQL Server ->> 存储过程sp_describe_first_result_set解析T-SQL语句的结果集结构信息
    Windows ->> 解决Windows 10下面无法多用户同时远程桌面
    SQL Server ->> 查询添加XLOCK表提示不阻塞其他线程
  • 原文地址:https://www.cnblogs.com/kekec/p/2253879.html
Copyright © 2011-2022 走看看