问题
This question already has an answer here:
- /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version CXXABI_1.3.8' not found [closed] 8 answers
When I run my program following a compile, I get the following error:
./prog: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version
CXXABI_1.3.8' not found (required by ./prog) ./prog: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version
GLIBCXX_3.4.19' not found (required by ./prog) ./prog: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /home/arman/lib/boost_1_55_0/stage/lib/libboost_serialization.so.1.55.0)
I have both boost 1.55.0 and gcc 4.9.0 installed in ~/lib/boost_1_55_0
and ~/lib/gcc-4.9.0
respectively, and I'm guessing this is why I'm having problems, but I'm unsure about how to go about fixing it.
my ~/.profile
contains the following line:
export LD_LIBRARY_PATH=/home/user/lib/boost_1_55_0/stage/lib:$LD_LIBRARY_PATH
回答1:
GCC 4.9 introduces a newer C++ ABI version than your system libstdc++ has, so you need to tell the loader to use this newer version of the library by adding that path to LD_LIBRARY_PATH
. Unfortunately, I cannot tell you straight off where the libstdc++ so for your GCC 4.9 installation is located, as this depends on how you configured GCC. So you need something in the style of:
export LD_LIBRARY_PATH=/home/user/lib/gcc-4.9.0/lib:/home/user/lib/boost_1_55_0/stage/lib:$LD_LIBRARY_PATH
Note the actual path may be different (there might be some subdirectory hidden under there, like `x86_64-unknown-linux-gnu/4.9.0´ or similar).
来源:https://stackoverflow.com/questions/23494103/version-cxxabi-1-3-8-not-found-required-by