首页 新闻 会员 周边 捐助

Thrift编译失败

0
悬赏园豆:50 [待解决问题]

报错信息: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版本冲突导致,但不知道如何解决
求各位指点

揽茝兮的主页 揽茝兮 | 初学一级 | 园豆:96
提问于:2022-11-23 18:00
< >
分享
所有回答(1)
0

这个错误可能是由于Thrift试图使用一个未正确安装或链接的Boost库版本造成的。以下是一些可能的解决方案:

  1. 确保已经安装了Boost库。你可以使用包管理器(如apt-getyum)来安装,例如在Ubuntu上,你可以运行:

    sudo apt-get install libboost-all-dev
    
  2. 检查是否正确链接到Boost库。编译Thrift时,需要确保链接到正确的Boost库。

  3. 尝试重新编译并安装Thrift。先清理之前的构建结果('make clean'或删除旧的构建目录),然后再重新配置和编译Thrift。

  4. 确保使用的是支持的Boost和Thrift版本。你当前使用的Thrift版本可能不支持新的Boost版本,或者反过来也可能。你可能需要降级或升级你的软件版本。

npe0 | 园豆:1502 (小虾三级) | 2023-12-12 17:29
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册