未解决的外部符号错误:无法解决
unresolved external symbol error: not able to solve it
编译代码时,出现以下未解决的外部符号错误。我正在使用第三方库。因此在编译代码时使用第三方库名称空间。
std_uss.obj:错误LNK2019:函数"
private: char * __thiscall os_std::basic_string<char,class os_std::char_traits_char,class os_std::allocator<char> >::allocate(unsigned int)
"(?allocate@?$basic_string@DVchar_traits_char@os_std@@V?$allocator@D@2@@os_std@@AAEPADI@Z
)中引用的未解析外部符号"__declspec(dllimport) void __cdecl os_std::os_throw_length_error(void)
"(__imp_?os_throw_length_error@os_std@@YAXXZ
)
我在第三部分库的一个文件中发现了os_throw_length_error函数,但在代码中没有发现任何类似于:allocater的函数。我并没有使用标准的std名称空间,因为我希望编译器使用第三方名称空间。
如果我使用标准的using namespace std
,那么我的编译是成功的,但一些定义(如字符串)被引用到visualstudio字符串,而不是第三方字符串函数。
您需要将第三方DLL的导入库(.lib文件)添加到项目中。在Visual Studio中,这将在项目属性中的Linker/Input/Extremental Dependencies 下
- 如何解决错误:SCIP C++中的 SCIP 阶段无效 <10>
- 解决错误:运算符 [] 不匹配
- 开发如何解决错误193:%1不是Dev C 中的Win32应用程序
- 我该如何解决错误,说明创建图形对象没有放置在图形场景中
- 如何解决错误 C2719 在 Visual Studio 2010 C++ 中不存在代码行时
- 如何在C++中使用 ZeroMQ 发送包含数组的结构时解决错误
- 使用strupr和strlwr时如何解决错误"invalid conversion of char to char*"?
- Eigen SparseLU解决错误读取访问冲突,这>m_sup_to_col被0x111011101110112
- 如何解决错误:在Mac上令牌"("之前缺少二进制运算符?
- 如何解决错误:从" int* "到" int "的转换无效
- 如何解决错误PRJ0002:错误结果 -1073741515从"cl.exe"返回?
- 如何解决错误LNK2019:未解析的外部符号
- 解决错误的一般方法:变量周围的堆栈'x'已损坏
- 如何在Xcode中将长双精度转换为字符串格式?或如何解决错误"use of undeclared identifier 'to_string' "
- Eclipse conio.h正在解决错误
- 需要帮助解决错误 C2664
- 如何解决错误LNK2019:未解析的外部符号
- 如何解决错误:LNK2019:未解析的外部符号"public"?
- 无法解决错误LNK2019:未解析的外部符号
- 如何解决错误C2039