报错信息:processor/ProcessorTest.o: In function void testExpectedError<TSimpleServerTraits, UntemplatedTraits>()': /opt/thrift/lib/cpp/test/processor/ProcessorTest.cpp:767: undefined reference to
boost::test_tools::tt_detail::report_assertion(boost::test_tools::assertion_result const&, boost::unit_test::lazy_ostream const&, boost::unit_test::basic_cstring<char const>, unsigned long, boost::test_tools::tt_detail::tool_level, boost::test_tools::tt_detail::check_type, unsigned long, ...)'
processor/ProcessorTest.o: In function lazy_ostream_impl': /opt/boost/boost/test/utils/lazy_ostream.hpp:76: undefined reference to
boost::unit_test::lazy_ostream::inst'
/opt/boost/boost/test/utils/lazy_ostream.hpp:76: undefined reference to boost::unit_test::lazy_ostream::inst' /opt/boost/boost/test/utils/lazy_ostream.hpp:76: undefined reference to
boost::unit_test::lazy_ostream::inst'
/opt/boost/boost/test/utils/lazy_ostream.hpp:76: undefined reference to boost::unit_test::lazy_ostream::inst' processor/ProcessorTest.o: In function
void testUnexpectedError<TSimpleServerTraits, UntemplatedTraits>()':
/opt/thrift/lib/cpp/test/processor/ProcessorTest.cpp:823: undefined reference to boost::test_tools::tt_detail::report_assertion(boost::test_tools::assertion_result const&, boost::unit_test::lazy_ostream const&, boost::unit_test::basic_cstring<char const>, unsigned long, boost::test_tools::tt_detail::tool_level, boost::test_tools::tt_detail::check_type, unsigned long, ...)' processor/ProcessorTest.o: In function
lazy_ostream_impl':
/opt/boost/boost/test/utils/lazy_ostream.hpp:76: undefined reference to boost::unit_test::lazy_ostream::inst' /opt/boost/boost/test/utils/lazy_ostream.hpp:76: undefined reference to
boost::unit_test::lazy_ostream::inst'
/opt/boost/boost/test/utils/lazy_ostream.hpp:76: undefined reference to boost::unit_test::lazy_ostream::inst' /opt/boost/boost/test/utils/lazy_ostream.hpp:76: undefined reference to
boost::unit_test::lazy_ostream::inst'
/opt/boost/boost/test/utils/lazy_ostream.hpp:76: undefined reference to boost::unit_test::lazy_ostream::inst' processor/ProcessorTest.o:/opt/boost/boost/test/utils/lazy_ostream.hpp:76: more undefined references to
boost::unit_test::lazy_ostream::inst' follow
有怀疑可能是boost版本冲突导致,但不知道如何解决
求各位指点
这个错误可能是由于Thrift试图使用一个未正确安装或链接的Boost库版本造成的。以下是一些可能的解决方案:
确保已经安装了Boost库。你可以使用包管理器(如apt-get
或yum
)来安装,例如在Ubuntu上,你可以运行:
sudo apt-get install libboost-all-dev
检查是否正确链接到Boost库。编译Thrift时,需要确保链接到正确的Boost库。
尝试重新编译并安装Thrift。先清理之前的构建结果('make clean'或删除旧的构建目录),然后再重新配置和编译Thrift。
确保使用的是支持的Boost和Thrift版本。你当前使用的Thrift版本可能不支持新的Boost版本,或者反过来也可能。你可能需要降级或升级你的软件版本。