在GNU/Linux下的Boost.Log链接错误 [英] Boost.Log linking errors under GNU/Linux
问题描述
我想测试Boost.Log库.不幸的是,我收到链接错误.
I would like to test the Boost.Log library. Unfortunately, I get link errors.
我使用Arch Linux,并且通过内置的软件包管理器pacman
安装了Boost头文件和库:
I use Arch Linux, and I installed Boost headers and libraries via built-in package manager pacman
:
- 提升1.54.0-3
- boost-libs 1.54.0-2
通过
When compiling the simple example from official site via g++ log.cpp -lboost_log -lpthread
, I get the following errors:
log.cpp:(.text+0x42): undefined reference to `boost::log::v2s_mt_posix::trivial::logger::get()'
log.cpp:(.text+0x9b): undefined reference to `boost::log::v2s_mt_posix::trivial::logger::get()'
...
我已阅读为什么我的应用程序无法与Boost.Log链接?,但是我无法解决链接错误.它只是给我的提示是boost::log::v2s_mt_posix::trivial::logger::get()
所在的库是静态链接的.但是在目录/usr/lib/
下,只有动态链接的Boost库具有扩展名.so
.
I've read Why my application fails to link with Boost.Log?, but I couldn't solve the link errors. It only gives me the hint that the library where boost::log::v2s_mt_posix::trivial::logger::get()
is in was linked statically. But under directory /usr/lib/
there are only dynamically linked Boost libraries with extension .so
.
也许有人知道这里出了什么问题.
Maybe, someone has a clue what's going wrong here.
谢谢.
推荐答案
您需要定义 查看全文