简体   繁体   English

社会图书馆未解决的符号错误

[英]Unresolved symbol error with the soci library

I understand what an unresolved symbol error is, but I don't understand why I'm getting it in this particular situation with this particular library. 我了解什么是无法解决的符号错误,但我不明白为什么在这种特定情况下使用此特定库会得到它。 Here is the output of the error. 这是错误的输出。

Undefined symbols for architecture x86_64:
  "soci::soci_error::soci_error(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
      soci::type_conversion<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, void>::from_base(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, soci::indicator, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&) in Inspector.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Note that I am using the following link flags: 请注意,我正在使用以下链接标志:

-L/usr/local/lib -lsoci_core -lsoci_postgresql -lpq -ldl

Note also that references to other symbols (eg, the soci::session constructor and destructor) are being resolved. 还请注意,正在解析对其他符号的引用(例如, soci::session构造函数和析构函数)。

What am I doing wrong? 我究竟做错了什么? Is there another soci library that I should also be linking against? 我还应该链接另一个社会图书馆吗?

EDIT : Note that I am working on Mac OS X, and have tried both the installation through homebrew (via brew install soci --with-pg ), and the standalone installations of 3.2.2 and 3.2.1. 编辑 :请注意,我在Mac OS X上工作,并且尝试通过自制程序(通过brew install soci --with-pg )以及独立安装的3.2.2和3.2.1进行尝试。

我不知道为什么这可以解决错误,但是从libc ++更改为libstdc ++可以解决此错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 未解析的SOCI外部符号“ struct soci :: mysql_backend_factory const soci :: mysql” - SOCI external symbol unresolved “struct soci::mysql_backend_factory const soci::mysql” Qt,库函数调用给出了未解决的外部符号错误 - Qt, Library function calling gives unresolved external symbol error 链接器错误:正式包含库时,未解析的符号 - Linker error: unresolved symbol, when library formally included 错误LNK2019:由于辅助库而导致无法解析的外部符号 - error LNK2019: unresolved external symbol due to helper library Boost 文件系统库中未解析的外部符号(错误 LNK2019) - Unresolved external symbol in Boost filesystem library (error LNK2019) 错误LNK2019:无法解析的外部符号(带有快照库的项目) - error LNK2019: unresolved external symbol (project with snappy library) 错误LNK2019未解析的外部符号 - 类库问题? - error LNK2019 unresolved external symbol - Class Library issue? 使用CImg库时无法解决的外部符号错误 - Unresolved external symbol error while using CImg library 在运行时动态加载库时出现错误“未解析的外部符号” - Error “unresolved external symbol” when library is dynamically loaded at runtime opencv 错误的未解决符号 - unresolved symbol for opencv error
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM