VS2012编译文件报错——error LNK2001: 没法解析的外部符号 __imp___CrtDbgReportW

错入显示如:多线程

1>  正在生成代码...
1>SurfDescriptor.obj : error LNK2001: 没法解析的外部符号 __imp___CrtDbgReportW
1>Validate.obj : error LNK2001: 没法解析的外部符号 __imp___CrtDbgReportW
1>Visualize.obj : error LNK2001: 没法解析的外部符号 __imp___CrtDbgReportW
1>FastHessian.obj : error LNK2019: 没法解析的外部符号 __imp___CrtDbgReportW,该符号在函数 "public: bool __thiscall std::_Tree_const_iterator<class std::_Tree_val<struct std::_Tree_simple_types<struct std::pair<int const ,class ResponseLayer *> > > >::operator==(class std::_Tree_const_iterator<class std::_Tree_val<struct std::_Tree_simple_types<struct std::pair<int const ,class ResponseLayer *> > > > const &)const " (??8?$_Tree_const_iterator@V?$_Tree_val@U?$_Tree_simple_types@U?$pair@$$CBHPAVResponseLayer@@@std@@@std@@@std@@@std@@QBE_NABV01@@Z) 中被引用
1>IPoint.obj : error LNK2001: 没法解析的外部符号 __imp___CrtDbgReportW
1>main.obj : error LNK2001: 没法解析的外部符号 __imp___CrtDbgReportW
1>Surf.obj : error LNK2001: 没法解析的外部符号 __imp___CrtDbgReportW
1>C:\Users\Administrator\Desktop\Surf-master\Debug\Surf.exe : fatal error LNK1120: 1 个没法解析的外部命令
========== 所有从新生成: 成功 0 个,失败 1 个,跳过 0 个 ==========
函数


解决方案:this

像这种状况,能够推测运用了错误的运行库包。

在一程序中使用不一样类型的运行时库或使用调试和非调试版本的运行时库,则将收到此连接错误。

例如,编译一个文件以使用一种运行时库,而编译另外一个文件以使用另外一种运行时库(例如单线程运行时库对多线程运行时库),试图连接它们,则将获得此警告。应将全部源文件编译为使用同一运行时库。

其实就是调正编译器选项参数:/MD、/MT   和   /LD

在VS2012中,在“配置属性-->C/C++-->代码生成-->运行时库”中将“多线程(/MT)或者(/MD)”统一改成“多线程调试(/MTd)”便可。
spa