gpt4 book ai didi

git - git : imap-send. c:1408 中的编译错误:错误: ‘CURLOPT_USERNAME’ 未声明

转载 作者:太空狗 更新时间:2023-10-29 14:31:45 25 4
gpt4 key购买 nike

我想将 git 安装到我只是一个没有“sudo”访问权限的用户的服务中。所以我不能使用 yum install git

我尝试从 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上查看了源代码,得到了代码的位置,但我无法理解为什么会发生错误。

我应该如何在没有管理权限的情况下将 git 安装到服务器 (CentOS)。

最佳答案

我自己解决了这个问题。

很明显问题是curl引起的。

  1. 使用which curl查看curl的正确路径。在我的服务器中,它是:/home/myname/Programs/Anaconda/bin/curl 所以是anaconda改变了我的curl。

  2. 通过
    设置curl路径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

关于git - git : imap-send. c:1408 中的编译错误:错误: ‘CURLOPT_USERNAME’ 未声明,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40955746/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com