c++ - Boost 编译标志 gcc 错误

标签 c++ linux gcc boost

我在编译示例表单 LenMuse 时遇到问题 - this is the example .

我使用了所提供教程中的标志,并添加了一些标志来解决其他一些问题,但我无法解决所有问题。这是我从 gcc 的输出:

    /usr/lib/liblomse.so: undefined reference to `boost::thread::start_thread()'
    /usr/lib/liblomse.so: undefined reference to `boost::thread::timed_join(boost::posix_time::ptime const&)'
    /usr/lib/liblomse.so: undefined reference to `boost::this_thread::sleep(boost::posix_time::ptime const&)'
    /usr/lib/liblomse.so: undefined reference to `boost::thread::~thread()'

这是我使用的命令:

gcc interface.cpp -o interface `pkg-config --cflags x11` `pkg-config --cflags liblomse` `pkg-config --libs liblomse` `pkg-config --libs x11` -lstdc++ -lboost_system -I/usr/include/boost/ -lboost_filesystem -lboost_thread

我尝试使用标志 -lboost_thread-mt 进行编译,但 gcc 找不到此标志。

我有 boost 1.53.0,作者在页面上说需要 boost 1.43 或更高版本。我的系统是 ArchLinux。

最佳答案

我通过将 boost 库降级到版本 1.49.0 解决了这个问题。

关于c++ - Boost 编译标志 gcc 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17146960/

相关文章:

c++ - const char * 作为动态数组的参数

linux - awk 模式可以匹配多行吗?

c - 在 C 中定义尽可能最小的宏

c - Glibc 和 uClibc 并排在一个系统上

windows - Linux 和 Windows 链接器之间的区别

c++ - Isspace 字符函数

c++ - 托管 C++ 与 com

c++ - 如何处理加载错误共享库版本的情况

php - DB2 iSeries PDO VARCHAR

linux - 无法写入通过 NFS 传送的 FIFO 文件