在GNU/Linux下的Boost.Log链接错误 [英] Boost.Log linking errors under GNU/Linux

查看:272
本文介绍了在GNU/Linux下的Boost.Log链接错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想测试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.

谢谢.

推荐答案

您需要定义 查看全文

登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆