Centos7编译安装git出错解决方案

在编译安装git时出现如下报错信息

imap-send.o: In function `sk_GENERAL_NAME_num':
/usr/local/include/openssl/x509v3.h:165: undefined reference to `OPENSSL_sk_num'
imap-send.o: In function `sk_GENERAL_NAME_value':
/usr/local/include/openssl/x509v3.h:165: undefined reference to `OPENSSL_sk_value'
imap-send.o: In function `sk_GENERAL_NAME_pop_free':
/usr/local/include/openssl/x509v3.h:165: undefined reference to `OPENSSL_sk_pop_free'
/usr/local/include/openssl/x509v3.h:165: undefined reference to `OPENSSL_sk_pop_free'
imap-send.o: In function `ssl_socket_connect':
/usr/local/src/git-2.11.1/imap-send.c:287: undefined reference to `OPENSSL_init_ssl'
/usr/local/src/git-2.11.1/imap-send.c:288: undefined reference to `OPENSSL_init_ssl'
/usr/local/src/git-2.11.1/imap-send.c:290: undefined reference to `TLS_method'
/usr/local/src/git-2.11.1/imap-send.c:303: undefined reference to `SSL_CTX_set_options'
collect2: error: ld returned 1 exit status
make: *** [git-imap-send] Error 1

问题有两种原因:

1. openssl与Anconda中自带的openssl冲突

    解决方法:设置/etc/profile 将含有Anconda路径的环境变量设置注释掉(需要重启,安装完git之后再改回来)

2. openssl的路径设置不对

    解决方法:在git编译步骤中的make操作之前,进行如下命令

which openssl // 获得openssl路径

/usr/local/openssl


./configure --with-openssl=/usr/local/openssl // 设置git的config

之后再进行make等操作

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值