centos7编译安装git出错
安装步骤是这样的:
1、下载git-2.11.0.tar.gz 到 /usr/local/src
[root@tCentos7 ~]# cd /usr/local/src [root@tCentos7 ~]# wget https://www.kernel.org/pub/software/scm/git/git-2.11.1.tar.gz
2、安装依赖的库
[root@tCentos7 ~]#yum groupinstall "Development Tools" [root@tCentos7 ~]# yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel perl-CPAN perl-devel perl-ExtUtils-Embed
3、 删除原本的安装的git
[root@tCentos7 ~]# yum remove git -y
4、编译安装
[root@tCentos7 ~]# cd /usr/local/src [root@tCentos7 ~]# tar -zvxf git-2.11.1.tar.gz [root@tCentos7 ~]# cd git-2.11.1 [root@tCentos7 ~]# ./configure [root@tCentos7 ~]# make [root@tCentos7 ~]# make install
在make这一步出错,错误代码:
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
好像跟OPENSSL有关,我升级了openssl,自带的是OpenSSL 1.0.1e-fips 11 Feb 2013,我把它升级到了openssl-1.1.0d