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

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 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!
  • ¥15 drone 推送镜像时候 purge: true 推送完毕后没有删除对应的镜像,手动拷贝到服务器执行结果正确在样才能让指令自动执行成功删除对应镜像,如何解决?
  • ¥15 求daily translation(DT)偏差订正方法的代码
  • ¥15 js调用html页面需要隐藏某个按钮
  • ¥15 ads仿真结果在圆图上是怎么读数的
  • ¥20 Cotex M3的调试和程序执行方式是什么样的?
  • ¥20 java项目连接sqlserver时报ssl相关错误