使用python编译caffe时出现问题,未定义对“std::\uuxx11::…”

2024-06-01 11:30:34 发布

您现在位置:Python中文网/ 问答频道 /正文

我曾经在ubuntu14.04上用PYTHON_LAYER:=1成功编译caffe。然后我切换到Ubuntu16.04,使用相同的设置但不同的内置软件,比如16.04版的g++5.4版,而不是14.04版的g++4.8版,我无法用python编译caffe。你能就这个问题给我一些建议吗?以下是我收到的错误消息的一部分

.build_release/lib/libcaffe.so: undefined reference to `std::overflow_error::overflow_error(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
.build_release/lib/libcaffe.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::find(char, unsigned long) const'
.build_release/lib/libcaffe.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_construct(unsigned long, char)'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libboost_python.so: undefined reference to `std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::_M_construct(unsigned long, wchar_t)@GLIBCXX_3.4.21'
//usr/lib/x86_64-linux-gnu/libtbb.so.2: undefined reference to `std::out_of_range::out_of_range(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@GLIBCXX_3.4.21'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libgflags.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::compare(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const@GLIBCXX_3.4.21'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libglog.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_create(unsigned long&, unsigned long)@GLIBCXX_3.4.21'
.build_release/lib/libcaffe.so: undefined reference to `std::out_of_range::out_of_range(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
collect2: error: ld returned 1 exit status
Makefile:619: recipe for target '.build_release/tools/caffe.bin' failed
make: *** [.build_release/tools/caffe.bin] Error 1

Tags: tognustringsobasiclinuxlibx86