liushahechoupangzhi 2015-01-17 09:19 采纳率: 0%
浏览 3177
已结题

VS2005编译出现error C2375的问题

MFC的工程,也用到了OPENGL。之前编译链接运行都没有问题,但是现在要增加一个模块,打算用vector来写,所以include了<vector>(代码完全没变,就增加了一行#include<vector>).这时候编译报错

1>c:\program files\microsoft visual studio 8\vc\include\eh.h(58) : error C2375: “terminate”: 重定义;不同的链接
1> c:\virtualsim\vsrad\2.0\include\runtime.h(122) : 参见“terminate”的声明
runtime.h也是一个用到的外部库,里面的terminate函数其实在程序里面并没有使用。求问高手有什么解决办法。

  • 写回答

3条回答 默认 最新

  • liushahechoupangzhi 2015-01-17 09:25
    关注

    因为terminate在程序里面没有用到所以在run_time.h中把terminate函数的声明注释掉了,现在编译也是可以通过了。
    不知道这样会不会有什么问题,有没有更好的解决方法。
    其次,注释掉之后还出现了链接错误1>MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: _printf 已经在 Libcmtd.lib(printf.obj) 中定义
    1>MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: _rand 已经在 Libcmtd.lib(rand.obj) 中定义
    1>MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: "public: virtual __thiscall std::exception::~exception(void)" (??1exception@std@@UAE@XZ) 已经在 Libcmtd.lib(stdexcpt.obj) 中定义
    1>MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: "public: __thiscall std::exception::exception(void)" (??0exception@std@@QAE@XZ) 已经在 Libcmtd.lib(stdexcpt.obj) 中定义
    1>MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: "public: __thiscall std::exception::exception(class std::exception const &)" (??0exception@std@@QAE@ABV01@@Z) 已经在 Libcmtd.lib(stdexcpt.obj) 中定义
    1>MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: "public: __thiscall std::exception::exception(char const * const &)" (??0exception@std@@QAE@ABQBD@Z) 已经在 Libcmtd.lib(stdexcpt.obj) 中定义
    1>MSVCRTD.lib(ti_inst.obj) : error LNK2005: "private: __thiscall type_info::type_info(class type_info const &)" (??0type_info@@AAE@ABV0@@Z) 已经在 Libcmtd.lib(typinfo.obj) 中定义
    1>MSVCRTD.lib(ti_inst.obj) : error LNK2005: "private: class type_info & __thiscall type_info::operator=(class type_info const &)" (??4type_info@@AAEAAV0@ABV0@@Z) 已经在 Libcmtd.lib(typinfo.obj) 中定义

    评论

报告相同问题?

悬赏问题

  • ¥15 逻辑谓词和消解原理的运用
  • ¥15 三菱伺服电机按启动按钮有使能但不动作
  • ¥15 js,页面2返回页面1时定位进入的设备
  • ¥200 关于#c++#的问题,请各位专家解答!网站的邀请码
  • ¥50 导入文件到网吧的电脑并且在重启之后不会被恢复
  • ¥15 (希望可以解决问题)ma和mb文件无法正常打开,打开后是空白,但是有正常内存占用,但可以在打开Maya应用程序后打开场景ma和mb格式。
  • ¥20 ML307A在使用AT命令连接EMQX平台的MQTT时被拒绝
  • ¥20 腾讯企业邮箱邮件可以恢复么
  • ¥15 有人知道怎么将自己的迁移策略布到edgecloudsim上使用吗?
  • ¥15 错误 LNK2001 无法解析的外部符号