glog compilation error solution

1. Compile command

g++ type_info.cc -o type_info -std=c++11 -lglog

2. Error message

/usr/local/lib/libgflags.so.2.2: undefined reference to `__cxa_throw_bad_array_new_length@CXXABI_1.3.8'
/usr/local/lib/libgflags.so.2.2: undefined reference to `std::__throw_out_of_range_fmt(char const*, ...)@GLIBCXX_3.4.20'
/usr/local/lib/libglog.so: undefined reference to `operator delete(void*, unsigned long)@CXXABI_1.3.9'

3. Current gcc version

gcc (GCC) 4.8.5

4. Solution

Upgrade gcc to gcc (GCC) 7.3.1, and upgrade libstdc++.so at the same time (mine is upgraded to libstdc++.so.6.0.26) the problem is solved

おすすめ

転載: blog.csdn.net/CSDN_WHB/article/details/113574045