2012-02-22 185 views
-1

我在编译代码时遇到无法解析的外部符号错误。我正在使用第三方库。因此在编译代码时使用第三方库名称空间。无法解析的外部符号错误:无法解决它

std_uss.obj : error LNK2019: unresolved external symbol " __declspec(dllimport) void __cdecl os_std::os_throw_length_error(void) " ([email protected][email protected]@YAXXZ) referenced in function " private: char * __thiscall os_std::basic_string<char,class os_std::char_traits_char,class os_std::allocator<char> >::allocate(unsigned int) " ([email protected][email protected][email protected][email protected]@[email protected]@[email protected]@[email protected]@[email protected])

我发现os_throw_length_error功能在第三部分库文件中的一个,但没有发现任何类似的功能::分配中的代码。我没有使用标准的std命名空间,因为我希望编译器使用第三方命名空间。

如果我使用using namespace std这是标准的,那么我的编译是成功的,但然后像字符串一些定义被引用到Visual Studio字符串而不是第三方字符串函数。

+0

_什么是第三方库? – 2012-02-22 11:36:55

+0

第三方库是递归软件的ospace – novice 2012-02-22 11:56:25

回答

0

您需要将第三方DLL的导入库(.lib文件)添加到您的项目中。在Visual Studio中,这将在项目属性中的链接器/输入/附加依赖项下

+0

我将所有.lib文件添加到其他依赖项中。我仍然看到同样的问题。 – novice 2012-02-22 11:46:34

+0

尝试运行.lib文件上的DUMPBIN/EXPORTS以查看链接器所投诉的符号(或类似符号)是否在导出符号列表中。 – AndrzejJ 2012-02-22 12:17:31

相关问题