Linux 安装 Git 问题解决 - make prefix=/usr/local/git all

一、说明

在 Linux 安装 Git 时一直报错,下面是安装步骤:

wget https://github.com/git/git/archive/v2.2.1.tar.gz
tar zxvf v2.2.1.tar.gz
cd git-2.2.1

make prefix=/usr/local/git all

执行最后一行代码时报以下错误:

   CC credential-store.o
In file included from cache.h:4,
                 from credential-store.c:1:
git-compat-util.h:327:23: error: wildmatch.h: No such file or directory
In file included from credential-store.c:1:
cache.h:5:20: error: strbuf.h: No such file or directory
cache.h:10:19: error: trace.h: No such file or directory
cache.h:11:25: error: string-list.h: No such file or directory
In file included from credential-store.c:1:
cache.h:1124: error: field ‘path’ has incomplete type
cache.h: In function ‘cache_def_clear’:
cache.h:1132: warning: implicit declaration of function ‘strbuf_release’
cache.h: At top level:
cache.h:1413: error: field ‘value_list’ has incomplete type
In file included from credential-store.c:2:
lockfile.h:64: error: field ‘filename’ has incomplete type
In file included from credential-store.c:3:
credential.h:7: error: field ‘helpers’ has incomplete type
credential-store.c: In function ‘parse_credential_file’:
credential-store.c:15: error: variable ‘line’ has initializer but incomplete type
credential-store.c:15: error: ‘STRBUF_INIT’ undeclared (first use in this function)
credential-store.c:15: error: (Each undeclared identifier is reported only once
credential-store.c:15: error: for each function it appears in.)
credential-store.c:15: error: storage size of ‘line’ isn’t known
credential-store.c:16: error: ‘STRING_LIST_INIT_DUP’ undeclared (first use in this function)
credential-store.c:25: warning: implicit declaration of function ‘strbuf_getline’
credential-store.c:15: warning: unused variable ‘line’
credential-store.c: In function ‘print_line’:
credential-store.c:51: warning: implicit declaration of function ‘strbuf_addch’
credential-store.c:52: error: dereferencing pointer to incomplete type
credential-store.c:52: error: dereferencing pointer to incomplete type
credential-store.c: In function ‘store_credential’:
credential-store.c:69: error: variable ‘buf’ has initializer but incomplete type
credential-store.c:69: error: ‘STRBUF_INIT’ undeclared (first use in this function)
credential-store.c:69: error: storage size of ‘buf’ isn’t known
credential-store.c:82: warning: implicit declaration of function ‘strbuf_addf’
credential-store.c:83: warning: implicit declaration of function ‘strbuf_addstr_urlencode’
credential-store.c:69: warning: unused variable ‘buf’
credential-store.c: In function ‘main’:
credential-store.c:125: error: ‘STRING_LIST_INIT_DUP’ undeclared (first use in this function)
make: *** [credential-store.o] Error 1

二、解决方案

将版本改为 2.11 后(下载 v2.11.0.tar.gz )再执行同样的步骤就不会报错了。

 

搞定!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值