解决Link 2001错误的一种方法
2016-03-17 10:29
330 查看
首先感谢:http://www.cppblog.com/kenlistian/archive/2008/11/14/66872.html
我想将PhysX SDK中的一个Sample(SampleRayCar) 独立出来。
我把所有原例子中的cpp和h文件都考到我新建的工程目录下之后,编译过了,但是连接出了问题,不知道怎么解决。
错误信息:
Car.obj : error LNK2019: unresolved external symbol __CrtDbgReportW referenced in function "public: bool __thiscall std::_Tree<class std::_Tmap_traits<float,float,struct std::less<float>,class std::allocator<struct std::pair<float const ,float> >,0> >::const_iterator::operator==(class std::_Tree<class std::_Tmap_traits<float,float,struct std::less<float>,class std::allocator<struct std::pair<float const ,float> >,0> >::const_iterator const &)const " (??8const_iterator@?$_Tree@V?$_Tmap_traits@MMU?$less@M@std@@V?$allocator@U?$pair@$$CBMM@std@@@2@$0A@@std@@@std@@QBE_NABV012@@Z)
1>NxAllVehicles.obj : error LNK2001: unresolved external symbol __CrtDbgReportW
1>NxVehicle.obj : error LNK2001: unresolved external symbol __CrtDbgReportW
我没注意到上面还有一个warning,如下:
LINK : warning LNK4098: 默认库“LIBCMT”与其他库的使用冲突;请使用 /NODEFAULTLIB:library
从这个warning中推断出来,是运用了错误的运行库包。
在一程序中使用不同类型的运行时库或使用调试和非调试版本的运行时库,则将收到此链接错误。
例如,编译一个文件以使用一种运行时库,而编译另一个文件以使用另一种运行时库(例如单线程运行时库对多线程运行时库),试图链接它们,则
将得到此警告。应将所有源文件编译为使用同一运行时库。
其实就是调正编译器选项参数:/MD、/MT 和 /LD
在vc8中,在“配置属性-->C/C++-->代码生成-->运行时库”中将“多线程(/MT)”统一改为“多线程调试(/MTd)”即可。
我想将PhysX SDK中的一个Sample(SampleRayCar) 独立出来。
我把所有原例子中的cpp和h文件都考到我新建的工程目录下之后,编译过了,但是连接出了问题,不知道怎么解决。
错误信息:
Car.obj : error LNK2019: unresolved external symbol __CrtDbgReportW referenced in function "public: bool __thiscall std::_Tree<class std::_Tmap_traits<float,float,struct std::less<float>,class std::allocator<struct std::pair<float const ,float> >,0> >::const_iterator::operator==(class std::_Tree<class std::_Tmap_traits<float,float,struct std::less<float>,class std::allocator<struct std::pair<float const ,float> >,0> >::const_iterator const &)const " (??8const_iterator@?$_Tree@V?$_Tmap_traits@MMU?$less@M@std@@V?$allocator@U?$pair@$$CBMM@std@@@2@$0A@@std@@@std@@QBE_NABV012@@Z)
1>NxAllVehicles.obj : error LNK2001: unresolved external symbol __CrtDbgReportW
1>NxVehicle.obj : error LNK2001: unresolved external symbol __CrtDbgReportW
我没注意到上面还有一个warning,如下:
LINK : warning LNK4098: 默认库“LIBCMT”与其他库的使用冲突;请使用 /NODEFAULTLIB:library
从这个warning中推断出来,是运用了错误的运行库包。
在一程序中使用不同类型的运行时库或使用调试和非调试版本的运行时库,则将收到此链接错误。
例如,编译一个文件以使用一种运行时库,而编译另一个文件以使用另一种运行时库(例如单线程运行时库对多线程运行时库),试图链接它们,则
将得到此警告。应将所有源文件编译为使用同一运行时库。
其实就是调正编译器选项参数:/MD、/MT 和 /LD
在vc8中,在“配置属性-->C/C++-->代码生成-->运行时库”中将“多线程(/MT)”统一改为“多线程调试(/MTd)”即可。
相关文章推荐
- 2月份处理钓鱼网站3799个:61.94%使用.com域名
- LightOj 1336 Sigma Function(打表找规律)
- 建立独立的OSG程序
- C++实现单链表
- Linnux命令大全(vim)
- 并行计算--Java--求π并行实现
- Bootstr 分页导航
- [LeetCode]129. Sum Root to Leaf Numbers
- iOS应用崩溃日志分析
- 敏捷测试驱动模式-项目质量保障体系
- linux /sys目录下各个子目录的具体说明
- Redis安装配置
- python网络爬虫入门(二)———模拟登陆知乎
- JDK安装和配置环境
- Betta
- Java内部类、本地类、匿名类、文件类解读
- 解析posix与perl标准的正则表达式区别
- C语言-结构体
- 查找一个字符串出现最多,并计算其次数
- tomcat集群中实现Session共享