Zealseeker
Zealseeker

Reputation: 823

compile error in git: imap-send.c:1408: error: ‘CURLOPT_USERNAME’ undeclared

I wanted to install git into a serve in which I was just an user without "sudo" access. So I cannot use yum install git.

I tried to download source code both from https://www.kernel.org/pub/software/scm/git/ (v2.11.0.tar.gz) and from github (v2.3.0.zip).
When compiling the souce the error happened:

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....

The two versions gave the same errors. I checked the source code from github and got the postion of the codes, but I could not understand why the error happened.

How should I isntall git into the server (CentOS) without administration access.

Upvotes: 2

Views: 1919

Answers (1)

Zealseeker
Zealseeker

Reputation: 823

I solved the problem by myself.

It was obvious that the problem was caused by curl.

  1. Use which curl to see the right path of curl. In my server, It was: /home/myname/Programs/Anaconda/bin/curl So it was anaconda that changed my curl.

  2. To set the curl path by
    git-2.11.0 $ ./configure --with-curl=$/home/myname/Programs/Anaconda/bin/curl
    before
    git-2.11.0 $ make prefix=/home/myname/path/to/install all
    and then
    git-2.11.0 $ make install prefix=/home/myname/path/to/install DESTDIR=/home/myname/path/to/install

Upvotes: 6

Related Questions