git升级、安装时出错,utf8.c:463: undefined reference to `libiconv'

make prefix=/usr/local/git all编译的时候出现了错误:

 LINK git-credential-store
libgit.a(utf8.o): In function `reencode_string_iconv':
/usr/src/git-2.8.3/utf8.c:463: undefined reference to `libiconv'
libgit.a(utf8.o): In function `reencode_string_len':
/usr/src/git-2.8.3/utf8.c:502: undefined reference to `libiconv_open'
/usr/src/git-2.8.3/utf8.c:521: undefined reference to `libiconv_close'
/usr/src/git-2.8.3/utf8.c:515: undefined reference to `libiconv_open'
collect2: ld returned 1 exit status
make: *** [git-credential-store] Error 1

解决如下:

一.安装libiconv

1# cd /usr/local/src
2# wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz
3# tar -zxvf libiconv-1.14.tar.gz
4# cd libiconv-1.14
5# ./configure --prefix=/usr/local/libiconv  &&  make  && make install

二.创建一个软链接到/usr/lib

1# ln -s /usr/local/lib/libiconv.so /usr/lib
2# ln -s /usr/local/lib/libiconv.so.2 /usr/lib

三.然后回到git目录继续编译

1# cd /usr/local/scr/git-2.8.3
2# make configure
3# ./configure --prefix=/usr/local --with-iconv=/usr/local/libiconv
4# make
5# make install

四.检查一下版本号

# git --version
  • 1
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值