c++ - Wangle:/usr/local/lib/libfolly.so: 对 boost::re_detail_106000 的 undefined reference

标签 c++ c++11 boost

我在安装Wangle的时候遇到了如下问题。我已经安装了 Boost,但我不知道为什么。

[ 65%] Built target wangle
Linking CXX executable bin/AcceptorTest
/usr/bin/ld: warning: libboost_filesystem.so.1.54.0, needed by /usr/local/lib/libfolly.so, may conflict with libboost_filesystem.so.1.61.0
/usr/bin/ld: warning: libboost_system.so.1.54.0, needed by /usr/local/lib/libfolly.so, may conflict with libboost_system.so.1.61.0
/usr/local/lib/libfolly.so: undefined reference to `boost::re_detail_106000::perl_matcher<char const*, std::allocator<boost::sub_match<char const*> >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::construct_init(boost::basic_regex<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > > const&, boost::regex_constants::_match_flags)'
/usr/local/lib/libfolly.so: undefined reference to `boost::re_detail_106000::get_mem_block()'
/usr/local/lib/libfolly.so: undefined reference to `boost::re_detail_106000::cpp_regex_traits_implementation<char>::transform_primary(char const*, char const*) const'
/usr/local/lib/libfolly.so: undefined reference to `boost::re_detail_106000::verify_options(unsigned int, boost::regex_constants::_match_flags)'
/usr/local/lib/libfolly.so: undefined reference to `boost::re_detail_106000::get_default_error_string(boost::regex_constants::error_type)'
/usr/local/lib/libfolly.so: undefined reference to `boost::re_detail_106000::perl_matcher<__gnu_cxx::__normal_iterator<char const*, std::string>, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::string> > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::construct_init(boost::basic_regex<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > > const&, boost::regex_constants::_match_flags)'
/usr/local/lib/libfolly.so: undefined reference to `boost::re_detail_106000::put_mem_block(void*)'
/usr/local/lib/libfolly.so: undefined reference to `boost::re_detail_106000::raise_runtime_error(std::runtime_error const&)'
/usr/local/lib/libfolly.so: undefined reference to `boost::re_detail_106000::cpp_regex_traits_implementation<char>::transform(char const*, char const*) const'
collect2: error: ld returned 1 exit status

make[2]: *** [bin/AcceptorTest] Error 1

make[1]: *** [CMakeFiles/AcceptorTest.dir/all] Error 2

make: *** [all] Error 2

enter image description here

最佳答案

使用 clang 而不是 gcc,删除 CMakeList.txt 中的原子检查并禁用测试,使 wangle 在 Arch 上为我构建。

目前无法使用 GCC 7 构建 (Issue) GCC 5 向我提出了与您类似的问题。

CC=clang CXX=clang cmake 。 -DBUILD_TEST=0

(上面的代码不包括您需要自己在 CMakeList.txt 中删除的原子检查!只需搜索 atomic。)

关于c++ - Wangle:/usr/local/lib/libfolly.so: 对 boost::re_detail_106000 的 undefined reference ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39076383/

相关文章:

c++ - 如何使用 RAII 包装返回错误代码的 C 分配

c++ - InterlockedIncrement 用法

c++ - C++ 的模块概念

c++ - 使用 std 或 boost 库的 C++ 中的 Qtimer 等效于什么?

c++ - 为什么 `boost::lower_bound` 按值接受它的参数?

c++ - 编译但得到 'uncaught exception of type std::bad_cast'

c++ - 如何通过引用返回一个 vector ,隐含地期望一个空 vector 作为输入?

c++ - c++中有指针的析构函数吗?

c++ - shared_ptr<> 的自定义删除器给出 'no context error'

c++ - std::priority_queue 的模板参数是什么?