Centos7 编译安装git 报错 git-compat-util.h:14:2: error

Centos7 编译安装git 报错 git-compat-util.h:14:2: error

环境:
OS:CentOS7.9
Git版本: git-2.38.1

一、报错现象

    [root@0773d8e7fe8f git-2.38.1]# make all doc info
        * new build flags
        CC fuzz-commit-graph.o
    In file included from commit-graph.h:4:0,
                     from fuzz-commit-graph.c:1:
    git-compat-util.h:14:2: error: #error "Required C99 support is in a test phase.  Please see git-compat-util.h for more details."
     #error "Required C99 support is in a test phase.  Please see git-compat-util.h for more details."
      ^
    make: *** [fuzz-commit-graph.o] Error 1

在这里插入图片描述

二、原因:

Git version>v2.35 added a balloon test for C99 support
(gitlab-git@7bc341e2).
This test caused builds to fail in CentOS 7, since this uses gcc
v4.8.5, which uses C90 () by default. C11 is a newer
standard than C90, and gcc v5.1.0 switched the default from
to .-std=gnu90std=gnu90std=gnu11
On other platforms, C11 may be required, so to fix the CentOS 7 issue
we only modify for CentOS 7.CFLAGS

三、解决:

sudo yum install centos-release-scl
sudo yum install devtoolset-7-gcc*
之后需要每次输入:
scl enable devtoolset-7 bash
来启用,否则gcc还是系统默认版本。
验证gcc版本
gcc --version
原版本
在这里插入图片描述
更新后版本
在这里插入图片描述

四、参考

原因
解决

  • 1
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值