【问题标题】:VisualStudio 6 to VS2010 migration: strange linker errorVisualStudio 6 到 VS2010 迁移:奇怪的链接器错误
【发布时间】:2013-06-20 16:31:41
【问题描述】:

我有一个 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)

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

谢谢!

【问题讨论】:

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


【解决方案1】:

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

你能发布 Visual Studio 使用的链接器命令吗?

【讨论】:

  • /OUT:"../plugins/rtc.dll" /INCREMENTAL /NOLOGO /LIBPATH:".." /DLL "../liboapc/Debug/liboapc.lib" "msvcrt.lib ” “Ws2_32.lib” “kernel32.lib” “user32.lib” “gdi32.lib” “winspool.lib” “comdlg32.lib” “advapi32.lib” “shell32.lib” “ole32.lib” “oleaut32.lib” " "uuid.lib" "odbc32.lib" "odbccp32.lib" /MANIFEST /ManifestFile:".\Debug\rtc.dll.intermediate.manifest" /ALLOWISOLATION /MANIFESTUAC:"level='asInvoker' uiAccess='false' " /DEBUG /PDB:"F:\demos\Debug\rtc.pdb" /SUBSYSTEM:CONSOLE /PGD:"F:\demos\Debug\rtc.pgd" /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:"。 \Debug\rtc.lib" /MACHINE:X86 /ERRORREPORT:QUEUE
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2012-06-08
  • 1970-01-01
  • 2010-12-30
  • 1970-01-01
  • 1970-01-01
  • 2017-01-02
相关资源
最近更新 更多