GLIBCX_3.4.21 not found
Solution 1
Replacing libstdc++(.so.6) with a later version will prevent the c++ compiler from working. But no issues by running applications depending on a later version of libstdc++.so.6
. Example : libstdc++.so.6.0.21 https://drive.google.com/file/d/0B7S255p3kFXNNTIzU2thRlZmYVE/view?usp=sharing
Or as package, libstdc++-5.1.0-1.el7.x86_64.rpm https://drive.google.com/file/d/0B7S255p3kFXNVFljeEFXV3d6RlU/view?usp=sharing ( # rpm -Uvh --force --nodeps [package]
) Note : You will need to do rpm -Uvh --force libstdc++-4.8.5-4.el7.x86_64.rpm
to replace the alien package with the default one http://mirror.centos.org/centos/7.2.1511/os/x86_64/Packages/libstdc++-4.8.5-4.el7.x86_64.rpm
Suggest : Build your applications, libraries with the default libstdc++.
EDIT : I just remembered the right solution for starting applications with a later version of a library. Say you have the new library as /opt/libcxx/{libstdc++-so.6 -> libstdc++.so.6.0.21}
Then you can do export LD_LIBRARY_PATH=/opt/libcxx:$LD_LIBRARY_PATH && [executeable]
, and /opt/libcxx/ will come first in the LD_LIBRARY_PATH. You can create a start script with the above command. Just like later versions of firefox was started in CentOS 4.
libzmq : # yum install autoconf automake libtool asciidoc xmlto libunwind-devel
Your version of libzmq ( version = 4.2.0 → $ sh version.sh >> VERSION
) has a bug.
However, "v4.1.6" is OK : git clone https://github.com/zeromq/zeromq4-1.git
Packages, from the edited libzmq/packaging/redhat/libzmq.spec : zeromq-4.1.6-1.el7.centos.x86_64.rpm
https://drive.google.com/file/d/0B7S255p3kFXNYllfbUhjd0c5Qm8/view?usp=sharing ... and zeromq-devel-4.1.6-1.el7.centos.x86_64.rpm
https://drive.google.com/file/d/0B7S255p3kFXNNExVMkpxQzlxcWc/view?usp=sharing
The packages provide /usr/bin/curve_keygen
, /usr/lib64/{libzmq.so.5 -> libzmq.so.5.0.1 <- libzmq.so, libzmq.a}
EDIT : Building zerorpc : git clone https://github.com/0rpc/zerorpc-python.git
# yum install python-devel python-setuptools
... cd zerorpc-python/
; # python(27) setup.py install
Solution 2
I didn't necessarily "fix" the problem, but I did find a solution. Since I'm using AWS, I launched an Ubuntu instance (compared to the Amazon Linux instance I was using originally), and moved the project over.
The reason for doing this is because Ubuntu uses a different package manager. After updating and installing all the basic things to run the project, I actually encountered the exact same error again.
I then ran the following commands, and the error went away:
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade
These commands were suggested in another stackoverflow post.
I won't mark this as the accepted answer since moving to a different distribution probably isn't a viable solution for most people.
Related videos on Youtube
Kacy
Updated on August 13, 2022Comments
-
Kacy over 1 year
I apologize if this isn't the right place for this, but after 2 days of dealing with the same error, I'm hoping someone will have an answer.
I am trying to use the node module zerorpc, which uses zmq, however, when trying to run a small example, I get the following error:
Error: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by myFilepath/node_modules/zmq/build/Release/zmq.node)
I'm using an amazon linux instance provided by AWS (amazon web services). After performing a
sudo yum update
, the latest version available is GLIBCXX_3.4.19. I checked using the following commands:strings /usr/lib64/libstdc++.so.6.19 | grep GLIBCXX strings /usr/lib64/libstdc++.so.6 | grep GLIBCXX
Initially, I got this error using
brew install zmq
, so I uninstalled it and tried installing zmq following the zeromq site's instructions:git clone https://github.com/zeromq/libzmq ./autogen.sh && ./configure && make -j 4 make check && make install && sudo ldconfig
The only difference I made to these instructions was that I ran them individually instead of using
&&
, and I added sudo in front of each one. I also executedexport LD_LIBRARY_PATH=/usr/local/lib
before running these.I then did
npm install zerorpc --save
. Of course, I received the same error, so I uninstalled zerorpc, did amake clean
, and started all the steps over, except this time I changed the configure instruction tosudo ./configure CXX=/usr/bin/g++ CC=/usr/bin/gcc
. And again, I received the same error.Hopefully someone has a suggestion. I really don't want to attempt to compile a newer gcc version from source as I know that will just be a new round of headaches.
-
Knud Larsen almost 8 yearsAmazon Linux AMI release 2016.03 : OK, glibc-2.17 , gcc-4.8.3 , yum , kernel-4.4.11 : That's close to CentOS 7 (RHEL7) .... I will try if libstc++-5.1.1 or similar will fit : To have the object GLIBCXX_3.4.21 available. And also make a test build of
libzmq
, preferably tolibzmq-4.2.0-1.el7-x86_64.rpm
...
-