MSVCRT.lib(ti_inst.obj) : error LNK2005: "private: __thiscall type_info::type_info(class type_info c
来源:互联网 发布:广州淘宝家具拍摄 编辑:程序博客网 时间:2024/06/09 19:40
在MFC程序中添加非MFC程序静态lib
1.MFC程序使用多线程(/MT)运行库,非MFC程序使用(/MT)运行库
此时只需要在属性页链接器->输入->忽略特定运行库中 添加MSVCRT.lib, 添加之后编译通过
非MFC程序中添加MFC程序静态lib
1.MFC程序使用多线程(/MT)运行库,非MFC程序使用(/MT)运行库
1>uafxcw.lib(afxmem.obj) : error LNK2005: "void * __cdecl operator new(unsigned int)" (??2@YAPAXI@Z) 已经在 LIBCMT.lib(new.obj) 中定义
1>uafxcw.lib(afxmem.obj) : error LNK2005: "void __cdecl operator delete(void *)" (??3@YAXPAX@Z) 已经在 LIBCMT.lib(delete.obj) 中定义
1>uafxcw.lib(afxmem.obj) : error LNK2005: "void * __cdecl operator new[](unsigned int)" (??_U@YAPAXI@Z) 已经在 LIBCMT.lib(new2.obj) 中定义
1>uafxcw.lib(afxmem.obj) : error LNK2005: "void __cdecl operator delete[](void *)" (??_V@YAXPAX@Z) 已经在 LIBCMT.lib(delete2.obj) 中定义
分析问题是重复定义,问题产生原因,CRT库和MFC库链接时顺序有误:
一般来说,必须先加载MFC库再加载CRT库,不然可能导致LNK2005.
在属性页链接器->输入->附加依赖项中 添加nafxcw.lib;libcmt.lib,编译发现还是报错
这是提示各种重定义,这里忽略掉MSVCRT.lib,编译通过
- MSVCRT.lib(ti_inst.obj) : error LNK2005: "private: __thiscall type_info::type_info(class type_info c
- MSVCRT.lib(ti_inst.obj) : error LNK2005: "private: __thiscall type_info::type_info(class type_info const &)" (??0type_info@@AAE@
- VC编译错误:msvcrtd.lib(ti_inst.obj) : error LNK2005: "private: __thiscall type_info::type_info(class typ
- VC编译错误:msvcrtd.lib(ti_inst.obj) : error LNK2005: "private: __thiscall type_info::type_info(class typ
- error LNK2005: "private: __thiscall type_info::type_info(class type_info const &)"
- error LNK2005: "private: __thiscall type_info::type_info(class&n
- LNK2005: __thiscall type_info::type_info(class type_info const &) already defined in LIBCMTD.lib
- type_info和typeid
- EVC const type_info::`vftable'
- type_info 和 typeid
- 关于type_info与typeid
- C++基础::typeid、type_info
- 关于type_info总结
- type_info::before的用途
- error LNK2001: unresolved external symbol "const type_info::`vftable'"
- c++之巧用type_info
- error LNK2005: ___xc_a already defined in msvcrt.lib(cinitexe.obj)
- typeid为type_info友元函数
- 为新对象生成编号经典实例,剖析C++对象的的三大件
- vitamio Fatal signal 11 (SIGSEGV) at 0xdeadbaad (code=1) bug
- angular中的$q与promise(综合)
- connect
- stm8的硬件
- MSVCRT.lib(ti_inst.obj) : error LNK2005: "private: __thiscall type_info::type_info(class type_info c
- 第一次写那么长的代码
- 安卓如何控制不会重复请求网络
- Apache apollo初探
- Different Ways to Add Parentheses
- 为什么项目中不使用jquerymobile
- SOAP1.1和1.2 深入解析WSDL
- Yii2.0 数据库基本操作
- jQuery选择器和事件