我在编译示例表单 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/