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 executed export 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 a make clean
, and started all the steps over, except this time I changed the configure instruction to sudo ./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.
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