我有一个DLL项目,编译,链接和正常工作与Visual Studio 6VisualStudio的6到VS2010迁移:奇怪的链接错误
现在,我已经装好了到Visual Studio 2010在旧的进口。 dsp文件VS2010问我要转换为.vcxproj文件。从那以后,我尝试编译新转换的项目,但在调试建立在这个奇怪的链接错误绊倒:
error LNK2019: unresolved external symbol __imp___CrtDbgReportW referenced in function "public: struct oapc_bin_head * const & __thiscall std::_Deque_const_iterator<struct oapc_bin_head *,class std::allocator<struct oapc_bin_head *> >::operator*(void)const " ([email protected][email protected]@[email protected][email protected]@@[email protected]@@[email protected]@[email protected]@XZ)
的_DEBUG编译开关在调试模式以及NDEBUG在释放模式定义。令人惊讶的是在发布模式下,错误是非常不同的:
error LNK2019: unresolved external symbol "__declspec(dllimport) void __cdecl std::_Xlength_error(char const *)" ([email protected]@@[email protected]) referenced in function "protected: void __thiscall std::deque<struct oapc_bin_head *,class std::allocator<struct oapc_bin_head *> >::_Xlen(void)const " ([email protected][email protected][email protected]@[email protected][email protected]@@[email protected]@@[email protected]@IBEXXZ)
任何想法在项目文件转换期间丢失了什么?
谢谢!
此答案有帮助吗? http://stackoverflow.com/questions/6003368/unresolved-externals-in-c-when-using-vectors-and-find和这个链接http://forum.ragezone.com/f728/vs2010-packui-fix-错误-lnk2019-784831/ – Amitd
不,对不起,没有帮助。 _DEBUG在调试版本中是强制性的,(不仅)assert()不存在时不能正常工作。 – Elmi
解决了至少调试版本问题:链接必须针对msvcrtd.lib而不是msvcrt.lib – Elmi