因业务需要安装7.4高版本gcc时报错:

configure: error: in `/usr/local/src/gcc-7.4.0/build/gcc':

configure: error: C++ preprocessor "/lib/cpp" fails sanity check
See `config.log' for more details.

make[3]: Leaving directory `/usr/local/src/gcc-7.4.0/build/gcc'

make[2]: *** [all-stage1-gcc] Error 2
make[2]: Leaving directory `/usr/local/src/gcc-7.4.0/build'
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory `/usr/local/src/gcc-7.4.0/build'
make: *** [all] Error 2

解决:

yum install -y glibc-headers gcc-c++ #参考链接https://www.cnblogs.com/niocai/archive/2011/11/04/2236458.html

知识点扩展:

在网上寻找解决方案时碰到一些人说是因内存不足需要添加swap分区来解决,未实际验证,这里给出添加swap分区的方法

添加命令

SWAP=/tmp/swap

dd if=/dev/zero of=$SWAP bs=1M count=500 #500为swap分区大小

mkswap $SWAP

swapon $SWAP #启用swap

当发现swap分区不够用,想继续加大时,需要先关闭正在使用的swap分区,然后重新分配

swapoff /tmp/swap 或者swapoff -a这两个命令均可关闭swap分区

注意:如果不关闭现有swap分区但想继续扩容swap分区时,当执行dd命令时会报如下错:

dd: failed to open ‘/tmp/swap’: Text file busy

另外根据需要可以将swap写入/etc/fstab使其永久生效

/tmp/swap swap swap defaults 0 0

编译gcc报错make[3]: Leaving directory `/usr/local/src/gcc-7.4.0/build/gcc' make[2]: *** [all-stage1-gcc] Error 2 处理的更多相关文章

  1. 编译php5.4的时候出现错误----configure: error: in `/usr/local/src/php540/php-5.4.0':

    错误如下:checking for grep that handles long lines and -e... /bin/grep checking for egrep... /bin/grep - ...

  2. linux,安装软件报错cannot create regular file '/usr/local/man/man1': No such file or directory

    make install时报错,如下 install: cannot create regular file '/usr/local/man/man1': No such file or direct ...

  3. 启动elk中elasticsearch服务报错which: no java in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin)

    解决办法: vi /etc/sysconfig/elasticsearch JAVA_HOME=/usr/local/java sudo systemctl restart elasticsearch ...

  4. CentOS6.6 编译Redis报错:"Newer version of jemalloc required"

    一.前言 不同系统同一个问题,可能解决方法不一样,也可能会遇到不同的问题,所以具体情况具体分析,我的系统是Centos6.6, 查看系统命令  cat /etc/issue 二.安装redis后编译报 ...

  5. 源码编译apache报错的解决方法

    源码编译apache报错的解决方法   问题介绍 在源码编译安装httpd时,./configure执行无错误,到make时就报错,在网络上搜索了很多文章,很多方法如换apr-util的低版本并不能很 ...

  6. LINUX下基于NVIDIA HPC SDK 的 VASP6.3.x编译安装报错整理

    关于gcc 用旧版本安装NVIDIA HPC SDK再编译会报错: "/opt/rh/devtoolset-8/root/usr/include/c++/8/bits/move.h" ...

  7. 编译PHP 报错:node.c: In function dom_canonicalization

    编译PHP 报错:node.c: In function dom_canonicalization  /opt/php-5.2.17/ext/dom/node.c:1953: error: deref ...

  8. idea中编译项目报错 java: javacTask: 源版本 1.8 需要目标版本 1.8

    问题如上面所叙: > idea中编译项目报错 java: javacTask: 源版本 1.8 需要目标版本 1.8 解决方案: > Setting->Compiler->Ja ...

  9. PHP编译安装报错:configure: error: mcrypt.h not found. Please reinstall libmcrypt

    我是在CentOS6.5安装php5.5.28这个版本,PHP编译代码如下: ./configure --prefix=/usr/local/php --with-config-file-path=/ ...

随机推荐

  1. PHP的isset()函数 一般用来检测变量是否设置

    PHP的isset()函数 一般用来检测变量是否设置 格式:bool isset ( mixed var [, mixed var [, ...]] ) 功能:检测变量是否设置 返回值: 若变量不存在 ...

  2. BP算法推导python实现

    def sigmoid(inX):   return 1.0/(1+exp(-inX))   '''标准bp算法每次更新都只针对单个样例,参数更新得很频繁sdataSet 训练数据集labels 训练 ...

  3. 201312-2 ISBN号码 Java

    就是把-去掉,然后验证,只需要改最后一位. import java.util.Scanner; public class Main { public static void main(String[] ...

  4. Ubuntu--- 安装VMware 报错 Build enviroment error!

    今天从 Ubuntu 安装 VMware 下载并安装过程都很顺利,但是在启动过程中报错误,所以总结如下: 报错原因:VMware 第一次启动需要编译一些模块,但是刚开始并没有安装 gcc 所以便报无法 ...

  5. BBS登录功能

    BBS登录功能 一.后端实现 1.实现验证码 from PIL import Image, ImageDraw, ImageFont import random from io import Byte ...

  6. visual studio2019下静态链接库的制作

    创建静态库项目 项目名称为20199324lib // pch.h #ifndef __PCH__ #define __PCH__ extern int add(int a, int b);//ext ...

  7. ruoyi HttpUtils

    package com.ruoyi.common.utils.http; import java.io.BufferedReader; import java.io.IOException; impo ...

  8. ThreadPoolExecutor自定义线程池

    1.ThreadPoolExecutor创建线程池的构造函数 public ThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long ...

  9. MFC的程序,不想显示窗口,任务栏里也不显示

    在dialog的oninitdialog里设置如下属性,很简单,网上一些乱七八糟的做法,一行代码就能搞定啊 SetWindowPos(&CWnd::wndNoTopMost,0,0,0,0,S ...

  10. kaggle注册获取数据

    安装谷歌访问助手,主要参考下面的作者写的 https://segmentfault.com/a/1190000020548973?utm_source=tag-newest 安装之后,打开蓝灯或其他翻 ...