centos 安装pcre报c++编译器错误

gcc已经安装了但是还报c++编译器不支持的错误。

于是找到如下组件安装:

yum install gcc-c++

再次安装pcre成功。

附:centos上源码安装gcc

http://my.oschina.net/vaero/blog/210485

# issue: configure: error: C++ compiler missing or inoperational
# 没有C++编译器
yum install gcc-c++

# issue: conftest.cpp:11:2: error: #error -static-libstdc++ not implemented
# 没有C,C++静态库
yum install glibc-static libstdc++-static -y
# 但报"No package libstdc++-static available",即没有-static-libstdc++源,问题仍存在。
# "checking whether g++ accepts -static-libstdc++ -static-libgcc"时报出的,可忽略。

# issue: conftest.c:10:25: error: isl/version.h: No such file or directory
# 没有ISL
wget ftp://gcc.gnu.org/pub/gcc/infrastructure/isl-0.12.2.tar.bz2
tar jxvf isl-0.12.2.tar.bz2
cd isl-0.12.2; ./configure
make; make install
cd ..

# issue: ./conftest: error while loading shared libraries: libisl.so.10: cannot open shared object file: No such file or directory
# 在"/usr/local/lib"目录下,怎么就它找不到。加到"/etc/ld.so.conf"或用"LD_LIBRARY_PATH"。
vi /etc/ld.so.conf  # 添加"/usr/local/lib"
ldconfig  # 重建/etc/ld.so.cache
# 自问:于**Issue 1**里,已经单独在"/etc/ld.so.conf.d"下建个"*.conf"添加过"/usr/local/lib",怎么没效果呢?
# 自答:之后安装的ISL,没重新ldconfig,所以找不到了?当时没查,不能确认。用以下命令:
strings /etc/ld.so.cache | grep libisl  # 查看
# 之后,删除了"/etc/ld.so.conf"内的添加,也不再有该问题。

原文地址:https://www.cnblogs.com/i-shu/p/4731585.html