GLIBCXX?? libopencv_videoio.so.3.4.3: undefined reference to 'std::__cxx11::basic_stringstream<char

335 views
Skip to first unread message

Sebastian Burlacu

unread,
Sep 5, 2018, 8:35:46 AM9/5/18
to Caffe Users
Hello,

Trying to compile caffe and running into trouble on the last few steps when doing make install.

GCC: 4.9.1
OpenCV: 3.4.3
Leveldb: 1.20
CMake: 3.4.3

I believe this is an issue with the GLIBCXX library I am loading - that make is looking for 3.4.21 but not finding it? I see the reference to 3.4.21 in my error messages down below. I have the correct libstdc++.so.6 file under my gcc installation (gcc/4.9.1/lib64/libstdc++.so.6) and this lib64 folder is in my LD_LIBRARY_PATH, so it *should* see it. As you can see from the strings output I do have support for 3.4.21.

$ strings /path/gcc/4.9.1/lib64/libstdc++.so.6 | grep GLIBCXX
GLIBCXX_3.4
GLIBCXX_3.4.1
GLIBCXX_3.4.2
GLIBCXX_3.4.3
GLIBCXX_3.4.4
GLIBCXX_3.4.5
GLIBCXX_3.4.6
GLIBCXX_3.4.7
GLIBCXX_3.4.8
GLIBCXX_3.4.9
GLIBCXX_3.4.10
GLIBCXX_3.4.11
GLIBCXX_3.4.12
GLIBCXX_3.4.13
GLIBCXX_3.4.14
GLIBCXX_3.4.15
GLIBCXX_3.4.16
GLIBCXX_3.4.17
GLIBCXX_3.4.18
GLIBCXX_3.4.19
GLIBCXX_3.4.20
GLIBCXX_3.4.21

However when I check the default library, 3.4.21 is not available, and this is what's making the installer error out.

$ strings /usr/lib64/libstdc++.so.6 | grep GLIBCXX
GLIBCXX_3.4
GLIBCXX_3.4.1
GLIBCXX_3.4.2
GLIBCXX_3.4.3
GLIBCXX_3.4.4
GLIBCXX_3.4.5
GLIBCXX_3.4.6
GLIBCXX_3.4.7
GLIBCXX_3.4.8
GLIBCXX_3.4.9
GLIBCXX_3.4.10
GLIBCXX_3.4.11
GLIBCXX_3.4.12
GLIBCXX_3.4.13
GLIBCXX_FORCE_NEW
GLIBCXX_DEBUG_MESSAGE_LENGTH

I have tried editing the Makefile to point to this directory and file

CFLAGS += "-I/path/gcc/4.9.1/lib64/ -b libstdc++.so.6"
LDFLAGS += "-b libstdc++.so.6"

But this didn't help.

$ make install
[  1%] Built target proto
Scanning dependencies of target caffe
[  1%] Linking CXX shared library ../../lib/libcaffe.so
[ 83%] Built target caffe
[ 84%] Linking CXX executable mnist/convert_mnist_data
[ 84%] Linking CXX executable cifar10/convert_cifar_data
[ 84%] Linking CXX executable device_query
[ 86%] Linking CXX executable siamese/convert_mnist_siamese_data
[ 87%] Linking CXX executable compute_image_mean
[ 87%] Linking CXX executable convert_imageset
[ 88%] Building CXX object tools/CMakeFiles/extract_features.dir/extract_features.cpp.o
[ 88%] Building CXX object tools/CMakeFiles/finetune_net.dir/finetune_net.cpp.o
[ 88%] Building CXX object tools/CMakeFiles/upgrade_net_proto_text.dir/upgrade_net_proto_text.cpp.o
[ 88%] Building CXX object tools/CMakeFiles/net_speed_benchmark.dir/net_speed_benchmark.cpp.o
[ 88%] Building CXX object tools/CMakeFiles/upgrade_solver_proto_text.dir/upgrade_solver_proto_text.cpp.o
[ 88%] Building CXX object tools/CMakeFiles/test_net.dir/test_net.cpp.o
[ 90%] Building CXX object tools/CMakeFiles/upgrade_net_proto_binary.dir/upgrade_net_proto_binary.cpp.o
[ 90%] Building CXX object tools/CMakeFiles/train_net.dir/train_net.cpp.o
[ 91%] Building CXX object tools/CMakeFiles/caffe.bin.dir/caffe.cpp.o
[ 91%] Building CXX object examples/CMakeFiles/classification.dir/cpp_classification/classification.cpp.o
/path/opencv/3.4.3/lib/libopencv_videoio.so.3.4.3: undefined reference to `VTT for std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >@GLIBCXX_3.4.21'
/path/opencv/3.4.3/lib/libopencv_imgcodecs.so.3.4.3: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::assign(char const*)@GLIBCXX_3.4.21'
/path/opencv/3.4.3/lib/libopencv_videoio.so.3.4.3: undefined reference to `std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >::basic_stringstream(std::_Ios_Openmode)@GLIBCXX_3.4.21'
/path/leveldb/1.20/lib/libleveldb.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_replace_aux(unsigned long, unsigned long, unsigned long, char)@GLIBCXX_3.4.21'

I've been troubleshooting and trying to compile caffe for two weeks now - any assistance would be much appreciated.

10377...@qq.com

unread,
Sep 27, 2018, 11:53:09 PM9/27/18
to Caffe Users
I have some problem similar with you,have you solved it?

在 2018年9月5日星期三 UTC+8下午8:35:46,Sebastian Burlacu写道:
Reply all
Reply to author
Forward
0 new messages