/lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by ./test)

153 views (last 30 days)
Kenneth Watanabe
Kenneth Watanabe on 19 Oct 2017
Commented: Kenneth Watanabe on 24 Oct 2017
Hello all, My server is currently running CentOS linux. I compiled a test Matlab script using the following command:
>> mcc -m test.m
This generated an executable file called "test".
I defined the LD_LIBRARY_PATH as follows since I was getting errors:
$ export LD_LIBRARY_PATH="/usr/local/MATLAB/R2017a/bin/glnxa64:$LD_LIBRARY_PATH";
$ export LD_LIBRARY_PATH="/usr/local/MATLAB/R2017a/runtime/glnxa64:$LD_LIBRARY_PATH"
But now, when I try to execute the test script I get a whole bunch of errors. Below are the first few errors:
./test: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by ./test)
./test: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /usr/local/MATLAB/R2017a/bin/glnxa64/libmwlaunchermain.so)
./test: /lib64/libstdc++.so.6: version `CXXABI_1.3.8' not found (required by /usr/local/MATLAB/R2017a/bin/glnxa64/libmwlaunchermain.so)
./test: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /usr/local/MATLAB/R2017a/bin/glnxa64/libmwcpp11compat.so)
I tried making a symoblic link as suggested from someone with similar problems but it did not help
$ sudo ln -s /usr/lib64/libstdc++.so.6 ./libstdc++.so.6
I also tried the following:
$ sudo yum install glibc
$ sudo yum install gcc
$ sudo yum install libgcc
$ sudo yum update
$ sudo yum upgrade
But nothing worked.
The strings command gives the following output:
$ strings /usr/lib64/libstdc++.so.6 | grep GLIBC
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
GLIBC_2.3
GLIBC_2.2.5
GLIBC_2.14
GLIBC_2.4
GLIBC_2.3.2
GLIBCXX_DEBUG_MESSAGE_LENGTH
Any help would be appreciated. Thanks in advance. Ken

Answers (1)

Rahul Goel
Rahul Goel on 23 Oct 2017
It appears that your application is still picking the libstdc++.so.6 from /lib64/ folder instead of the one shipped by MCR. It can be due to multiple resons(like LD_LIBRARY_PATH not being correctly set.). Do the following on the linux prompt to determine the location of libstdc++ your application is currently pointing to and change the LD_LIBRARY_PATH accordingly to let it pick from the MCR:
% ldd test | grep libstdc++
  1 Comment
Kenneth Watanabe
Kenneth Watanabe on 24 Oct 2017
I ran "ldd test | grep libstdc+" and got the following output:
ldd test | grep libstdc+
./test: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by ./test)
./test: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /usr/local/MATLAB/R2017a/bin/glnxa64/libmwlaunchermain.so)
./test: /lib64/libstdc++.so.6: version `CXXABI_1.3.8' not found (required by /usr/local/MATLAB/R2017a/bin/glnxa64/libmwlaunchermain.so)
./test: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /usr/local/MATLAB/R2017a/bin/glnxa64/libmwcpp11compat.so)
./test: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /usr/local/MATLAB/R2017a/bin/glnxa64/libmwi18n.so)
./test: /lib64/libstdc++.so.6: version `CXXABI_1.3.8' not found (required by /usr/local/MATLAB/R2017a/bin/glnxa64/libmwi18n.so)
./test: /lib64/libstdc++.so.6: version `CXXABI_1.3.8' not found (required by /usr/local/MATLAB/R2017a/bin/glnxa64/libmwservices.so)
./test: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /usr/local/MATLAB/R2017a/bin/glnxa64/libmwservices.so)
./test: /lib64/libstdc++.so.6: version `CXXABI_1.3.8' not found (required by /usr/local/MATLAB/R2017a/bin/glnxa64/libboost_filesystem.so.1.56.0)
./test: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /usr/local/MATLAB/R2017a/bin/glnxa64/libboost_filesystem.so.1.56.0)
./test: /lib64/libstdc++.so.6: version `CXXABI_1.3.8' not found (required by /usr/local/MATLAB/R2017a/bin/glnxa64/libicuuc.so.56)
./test: /lib64/libstdc++.so.6: version `CXXABI_1.3.8' not found (required by /usr/local/MATLAB/R2017a/bin/glnxa64/libicui18n.so.56)
./test: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /usr/local/MATLAB/R2017a/bin/glnxa64/libut.so)
./test: /lib64/libstdc++.so.6: version `CXXABI_1.3.8' not found (required by /usr/local/MATLAB/R2017a/bin/glnxa64/libut.so)
./test: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /usr/local/MATLAB/R2017a/bin/glnxa64/libmwfl.so)
./test: /lib64/libstdc++.so.6: version `CXXABI_1.3.8' not found (required by /usr/local/MATLAB/R2017a/bin/glnxa64/libmwfl.so)
./test: /lib64/libstdc++.so.6: version `CXXABI_1.3.8' not found (required by /usr/local/MATLAB/R2017a/bin/glnxa64/libmx.so)
./test: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /usr/local/MATLAB/R2017a/bin/glnxa64/libmwlivecode.so)
./test: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /usr/local/MATLAB/R2017a/bin/glnxa64/libmwregexp.so)
./test: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /usr/local/MATLAB/R2017a/bin/glnxa64/libmwmpath.so)
./test: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /usr/local/MATLAB/R2017a/bin/glnxa64/libmwflstoragevfs.so)
./test: /lib64/libstdc++.so.6: version `CXXABI_1.3.8' not found (required by /usr/local/MATLAB/R2017a/bin/glnxa64/libmwmlutil.so)
./test: /lib64/libstdc++.so.6: version `CXXABI_1.3.8' not found (required by /usr/local/MATLAB/R2017a/bin/glnxa64/libmwsettingscore.so)
./test: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /usr/local/MATLAB/R2017a/bin/glnxa64/libmwsettingscore.so)
./test: /lib64/libstdc++.so.6: version `CXXABI_1.3.8' not found (required by /usr/local/MATLAB/R2017a/bin/glnxa64/libmwms.so)
./test: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /usr/local/MATLAB/R2017a/bin/glnxa64/libmwopcmodel.so)
./test: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /usr/local/MATLAB/R2017a/bin/glnxa64/libmwopczippackage.so)
./test: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /usr/local/MATLAB/R2017a/bin/glnxa64/libmwopcmwservices.so)
./test: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /usr/local/MATLAB/R2017a/bin/glnxa64/libmwwebproxy.so)
./test: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /usr/local/MATLAB/R2017a/bin/glnxa64/libboost_log.so.1.56.0)
./test: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /usr/local/MATLAB/R2017a/bin/glnxa64/libboost_regex.so.1.56.0)
./test: /lib64/libstdc++.so.6: version `CXXABI_1.3.8' not found (required by /usr/local/MATLAB/R2017a/bin/glnxa64/libboost_regex.so.1.56.0)
./test: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /usr/local/MATLAB/R2017a/bin/glnxa64/libboost_serialization.so.1.56.0)
./test: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /usr/local/MATLAB/R2017a/bin/glnxa64/libCppMicroServices.so.3.0.0)
./test: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /usr/local/MATLAB/R2017a/bin/glnxa64/libPocoCrypto.so.31)
./test: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /usr/local/MATLAB/R2017a/bin/glnxa64/libPocoFoundation.so.31)
./test: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /usr/local/MATLAB/R2017a/bin/glnxa64/libPocoJSON.so.31)
./test: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /usr/local/MATLAB/R2017a/bin/glnxa64/libPocoNet.so.31)
./test: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /usr/local/MATLAB/R2017a/bin/glnxa64/libPocoUtil.so.31)
./test: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /usr/local/MATLAB/R2017a/bin/glnxa64/libPocoXML.so.31)
./test: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /usr/local/MATLAB/R2017a/bin/glnxa64/libmwdservices.so)
./test: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /usr/local/MATLAB/R2017a/bin/glnxa64/libmwflnetwork.so)
./test: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /usr/local/MATLAB/R2017a/bin/glnxa64/libmwstoragefileprovider.so)
./test: /lib64/libstdc++.so.6: version `CXXABI_1.3.8' not found (required by /usr/local/MATLAB/R2017a/bin/glnxa64/libmwfoundation_extdata_array.so)
./test: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /usr/local/MATLAB/R2017a/bin/glnxa64/libmwfoundation_extdata_array.so)
./test: /lib64/libstdc++.so.6: version `CXXABI_1.3.8' not found (required by /usr/local/MATLAB/R2017a/bin/glnxa64/libmwxmlcore.so)
libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007f54b5573000)

Sign in to comment.

Tags

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by