您的位置:首页 > 其它

Git 通过源码编译安装 2.12.2 遇到的问题及解决

2017-04-11 10:13 726 查看
Git 源码:

https://github.com/git/git/releases
wget https://github.com/git/git/archive/v2.12.2.tar.gz[/code] 
错误:

Can't locate ExtUtils/MakeMaker.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl


解决,安装 install perl-ExtUtils-CBuilder perl-ExtUtils-MakeMaker 即可:

yum install perl-ExtUtils-CBuilder perl-ExtUtils-MakeMaker


错误:

LINK git-credential-store
libgit.a(utf8.o): In function `reencode_string_iconv’:
/opt/git-master/utf8.c:530: undefined reference to `libiconv’
libgit.a(utf8.o): In function `reencode_string_len’:
/opt/git-master/utf8.c:569: undefined reference to `libiconv_open’
/opt/git-master/utf8.c:588: undefined reference to `libiconv_close’
/opt/git-master/utf8.c:582: undefined reference to `libiconv_open’
collect2: ld returned 1
make: *** [git-credential-store] error 1


解决,安装 libiconv 即可

https://ftp.gnu.org/gnu/libiconv/
wget https://ftp.gnu.org/gnu/libiconv/libiconv-1.15.tar.gz tar -xvf libiconv-1.15.tar.gz
cd libiconv-1.15
./configure --prefix=/usr/local/libiconv && make && make install


然后 git 重新安装

make configure
./configure --prefix=/usr/local/git --with-iconv=/usr/local/libiconv
make && make install
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  git