LNK2019:未定义的外部符号_Getgloballocale, Visual Studio 2013

LNK2019: Undefined external symbol _Getgloballocale, Visual Studio 2013

本文关键字:Getgloballocale Visual Studio 2013 符号 未定义 外部 LNK2019      更新时间:2023-10-16

我在Visual Studio 2013解决方案的一个项目中有以下链接器错误:

error LNK2019: unresolved external symbol "__declspec(dllimport) public: static class std::locale::_Locimp * __cdecl std::locale::_Getgloballocale(void)" (__imp_?_Getgloballocale@locale@std@@SAPEAV_Locimp@12@XZ) referenced in function "class std::ctype<char> const & __cdecl std::use_facet<class std::ctype<char> >(class std::locale const &)" (??$use_facet@V?$ctype@D@std@@@std@@YAAEBV?$ctype@D@0@AEBVlocale@0@@Z)

在所有的项目中,我都动态链接了运行时库(/MD)。

我考虑了以下帖子中的提示:

  • c++链接器无法解析的外部符号
  • 什么库我需要将我的混合模式应用程序链接到?
  • 提高- - - - - -使用/MT编译链接时无法解析的外部符号/MD
  • 链接错误2001:无法解析的外部符号
  • Visual c++中多个项目之间的链接错误

但无法解决此问题。

实际上,我甚至不知道在项目_Getgloballocale被使用的地方。也许知道_Getgloballocale所在的库也会有所帮助。

项目使用以下库:

    旋度
  • Protobuf
  • libboost_thread-vc120-mt-1_56.lib
  • libboostrongystem-vc120-mt-1_56.lib
  • libboost_python-vc120-mt-1_56.lib
  • libboost_filesystem-vc120-mt-1_56.lib

在所有的项目中,我都动态链接了运行时库(/MD)。

正如其他人所指出的,验证这一点可能没有看起来那么明显。首先,您的一些库可能会拖入外部依赖项,而依赖于不匹配的运行时。

建议您链接/VERBOSE on(在您的EXE项目中,properties/linker/general/show progress),并搜索输出转储的MSVCR。您可能会捕获到不同的版本(msvcr100.lib)或不同的配置(msvcr120d.lib)。还要尝试搜索LIBCMT——这是用于静态运行时链接的库。这些通常作为/DEFAULTLIB链接器指令的一部分出现,您应该能够从转储中了解该指令存在于哪个库上下文中。

您也可以在这里发布详细的输出(或相关的代码片段),我们可以尝试帮助解释它。

相关文章:
  • 没有找到相关文章