[英]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.