fbpx

Archive

How to install and update GCC on Centos 7

I will show you How to install and update GCC on Centos 7 step by step. Just follow my steps and if you get any error just comment on this post i will reply as soon as possible.

If your centos 7 is freshly installed you need to update our centos 7.

yum update

After that just install some basic requirements that will be needed nex steps.

yum install bzip2
yum install wget
yum install nano

How to install GCC on Centos 7

Just follow same steps as centos 6 and compile GCC on your machine. You must made a change for centos 7. Only one difference is at 7 step when you are compiling GCC.

Adjust your command as your need :

../gcc-6.1.0/configure –enable-languages=c,c++ –disable-multilib && make -j <number of CPU cores> && sudo make install && echo “success”

you have too add these paramaters : –enable-languages=c,c++ –disable-multilib

Other step as same as follows

How To Install Newer Version Of GCC on CentOS 6.x

 

How to solve GLIBCXX Not Found Error on Centos 7

 

Just follow these steps (You must compile newer version of GCC):

cd /usr/local/lib64
cp libstdc++.so.6.0.22 /usr/lib64/
cd /usr/lib64/
mv libstdc++.so.6 libstdc++.so.6.OLD
ln -sf libstdc++.so.6.0.22 libstdc++.so.6

This will solve these problems :

libstdc++.so.6 not found CentOS 7.3
/lib64/libstdc++.so.6: version `GLIBCXX_3.4.21′ not found

 

Lets Check :

strings /usr/lib64/libstdc++.so.6 | grep GLIBCXX

Output :

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
GLIBCXX_3.4.20
GLIBCXX_3.4.21
GLIBCXX_3.4.22