位置:首页  >   服务器笔记  > linux centos编译node报错

linux centos编译node报错

linux centos编译node报错
WARNING: C++ compiler too old, need g++ 4.8 or clang++ 3.4 (CXX=g++)
我查看了我的版本是
[root@Action node-v4.2.3]# g++ --version
g++ (GCC) 4.4.7 20120313 (Red Hat 4.4.7-16)
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

于是我只好安装4.8版本,从网上找到了方法
这里我用的是root用户
cd ~
http://ftp.tsukuba.wide.ad.jp/software/gcc/releases/gcc-4.8.1/gcc-4.8.1.tar.gz
tar zxvf gcc-4.8.1.tar.gz
cd gcc-4.8.1
./contrib/download_prerequisites  //下载所需要的依赖包
cd ..
mkdir gcc-build-4.8.1
../gcc-4.8.1/configure --enable-checking=release --enable-languages=c,c++ --disable-multilib
make 
make install

//如果是64位系统,则下面为lib64/
cp ~/gcc-build-4.8.1/prev-x86_64-unknown-linux-gnu/libstdc++-v3/src/.libs/libstdc++.so.6.0.18 /usr/lib 
ln -sf /usr/lib/libstdc++.so.6.0.18 /usr/lib/libstdc++.so.6
下面查看版本
g++ --version
[root@Action gcc.4.8.1]# g++ --version
g++ (GCC) 4.8.1
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

文章属性
精彩评论