C语言error2005,c – 是什么导致VS2013错误LNK2005:__xi_a已在MSVCRT.lib(cinitexe.obj)中定义?...

我的解决方案昨天建成今天除了.hpp和.cpp文件之外什么也没改变.

Visual Studio 2013中的完整错误文本(使用2013年11月的CTP):

Error 1 error LNK2005: __xi_a already defined in MSVCRT.lib(cinitexe.obj) C:\Users\drtwox\dev\repos\game\trunk\engine\game\LIBCMT.lib(crt0init.obj) game

Error 2 error LNK2005: __xi_z already defined in MSVCRT.lib(cinitexe.obj) C:\Users\drtwox\dev\repos\game\trunk\engine\game\LIBCMT.lib(crt0init.obj) game

Error 3 error LNK2005: __xc_a already defined in MSVCRT.lib(cinitexe.obj) C:\Users\drtwox\dev\repos\game\trunk\engine\game\LIBCMT.lib(crt0init.obj) game

Error 4 error LNK2005: __xc_z already defined in MSVCRT.lib(cinitexe.obj) C:\Users\drtwox\dev\repos\game\trunk\engine\game\LIBCMT.lib(crt0init.obj) game

Error 7 error LNK1169: one or more multiply defined symbols found C:\Users\drtwox\dev\repos\game\trunk\engine\build\x64\Test\game.exe 1 1 game

关于捅眼睛有用…

You are mixing code that was compiled with /MD (use DLL version of

CRT) with code that was compiled with /MT (use static CRT library).

That cannot work,all source code files must be compiled with the same

setting. Given that you use libraries that were pre-compiled with /MD,

almost always the correct setting,you must compile your own code with

this setting as well.

我已检查(并重新检查)解决方案中的所有项目仍在使用相同的运行时库;用于发布的多线程DLL和用于调试的多线程调试DLL.我完成了一个完整的解决方案重建,以确保.

Subversion日志显示自2013-12-04以来未包含所有第三方库的“外部”目录;一个月前.我检查了他们的配置并重建了它们.

Subversion日志还显示自昨天以来仅修改了现有的.hpp和.cpp文件.没有添加新库,没有新的外部头文件#included,也没有更改项目配置.在7个文件中有超过200行已更改和新代码.

可能是什么问题呢?

解决方案:问题不是错误/ MT / MD编译器标志,它是GLEW库和缺少#define GLEW_STATIC.我将GLEW项目设置更改为使用/ Zl(忽略默认库名称),如下所示:@L_502_3@.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值