VisualStudio 6到VS2010迁移:奇怪的链接器错误

时间:2013-06-24 08:18:47

标签: visual-studio-2010 linker-errors visual-studio-6

我有一个DLL项目,可以编译,链接并与Visual Studio 6一起正常工作。

现在我已将其加载到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 " (??D?$_Deque_const_iterator@PAUoapc_bin_head@@V?$allocator@PAUoapc_bin_head@@@std@@@std@@QBEABQAUoapc_bin_head@@XZ)

_DEBUG编译开关在调试模式下定义,在发布模式下定义为NDEBUG。令人惊讶的是,在发布模式下,错误完全不同:

error LNK2019: unresolved external symbol "__declspec(dllimport) void __cdecl std::_Xlength_error(char const *)" (__imp_?_Xlength_error@std@@YAXPBD@Z) referenced in function "protected: void __thiscall std::deque<struct oapc_bin_head *,class std::allocator<struct oapc_bin_head *> >::_Xlen(void)const " (?_Xlen@?$deque@PAUoapc_bin_head@@V?$allocator@PAUoapc_bin_head@@@std@@@std@@IBEXXZ)

在项目文件转换过程中丢失了什么想法?

谢谢!

1 个答案:

答案 0 :(得分:0)

看起来你在链接到std dll时遇到了一些问题。 它可以像在x64中构建两个中的一个而在x86中构建另一个,只是不将dll添加到链接或类似的东西。

你可以发布visual studio使用的链接器命令吗?

相关问题