在Visual Studio 2010上的C++链接错误x64

问题描述:

我正在将C++代码库从VS2005升级到VS2010,我正在重建一些第三方C++依赖项。我没有问题构建这些32位,但继续遇到连接64位(x64)的问题。我遇到了一些标准库函数未解决的外部问题。例如:在Visual Studio 2010上的C++链接错误x64

error LNK2001: unresolved external symbol "__declspec(dllimport) public: __cdecl std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::~basic_string<char,struct std::char_traits<char>,class std::allocator<char> >(void)" ([email protected][email protected]@[email protected]@[email protected]@[email protected]@[email protected]@[email protected]) 

error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >(char const *)" ([email protected][email protected]@[email protected]@[email protected]@[email protected]@[email protected]@[email protected]@Z) referenced in function "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl YAML::Exp::Escape(class YAML::Stream &,int)" ([email protected]@[email protected]@[email protected][email protected]@[email protected]@[email protected]@[email protected]@[email protected]@[email protected]@[email protected]) 

我想明确地将msvcprtd.lib的连接线和启用图书馆分辨率调试和这似乎是搜索C:\ Program Files文件(x86)的\微软的Visual Studio 10.0 \ VC \ LIB \ amd64 \ msvcprtd.lib的符号,但没有找到它们。

任何人都知道为什么会发生这种情况?

您可以尝试启用/ showIncludes来查看正在引入的头文件。因为一般情况下我会希望将这些函数内联到您的结果二进制文件中。

+0

看起来像是这个问题。它似乎包括从旧VS使用。我最终追查了这个问题。在D&S \ Application Data \ MSBuild中有属性表指向较旧的VS包含目录。 – Trevor 2010-07-23 15:27:33