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