2016-12-04 458 views
0

我想安裝的git成一個發球局中,我只是沒有「命令」訪問的用戶。所以我不能使用yum install git編譯錯誤的git:IMAP-send.c:1408:錯誤:「CURLOPT_USERNAME」未申報

我試着從https://www.kernel.org/pub/software/scm/git/(v2.11.0.tar.gz)和github(v2.3.0.zip)下載源代碼。
當編譯烴源的錯誤發生了:

imap-send.c: In function ‘setup_curl’: 
imap-send.c:1408: error: ‘CURLOPT_USERNAME’ undeclared (first use in this function) 
imap-send.c:1408: error: (Each undeclared identifier is reported only once 
imap-send.c:1408: error: for each function it appears in.) 
imap-send.c:1409: error: ‘CURLOPT_PASSWORD’ undeclared (first use in this function) 
imap-send.c:1434: error: ‘CURLOPT_USE_SSL’ undeclared (first use in this function) 
imap-send.c:1434: error: ‘CURLUSESSL_TRY’ undeclared (first use in this function) 
make: *** [imap-send.o] Error 1 
make: *** Waiting for unfinished jobs.... 

兩個版本作出了同樣的錯誤。我檢查了github的源代碼並獲得了代碼的位置,但我不明白爲什麼會發生錯誤。

我應該如何6.在安裝的git到服務器(CentOS的),沒有管理權限。

+0

您可能需要先安裝捲曲的新版本。 – melpomene

+0

@melpomene嗨,我的捲曲的版本是'捲曲7.49.0下(x86_64-PC-Linux的GNU)的libcurl/7.49.0的OpenSSL/1.0.2j的zlib/1.2.8'。版本不算太舊,是嗎? – Zealseeker

+0

通過「捲曲」我的意思是的libcurl(捲曲庫)及其具體頭('curlver.h'應該包含相關版本號碼)。 – melpomene

回答

3

我自己解決了這個問題。

很明顯,這個問題是由捲曲引起的。

  1. 使用which curl查看捲曲的正確路徑。在我的服務器上,它是: /home/myname/Programs/Anaconda/bin/curl所以這是anaconda改變了我的捲曲。

  2. 設置由
    git-2.11.0 $ ./configure --with-curl=$/home/myname/Programs/Anaconda/bin/curl
    捲曲路徑之前
    git-2.11.0 $ make prefix=/home/myname/path/to/install all
    然後
    git-2.11.0 $ make install prefix=/home/myname/path/to/install DESTDIR=/home/myname/path/to/install