Gcc Can';t在RHEL 7.3上构建最新的libcurl

Gcc Can';t在RHEL 7.3上构建最新的libcurl,gcc,libcurl,rhel7,Gcc,Libcurl,Rhel7,为了在RHEL 7.3上安装最新的libcurl,修复此编译错误的正确方法是什么 我已经能够获得最新的openssl,构建并安装它OpenSSL 1.1.1-dev xx XXX xxxx现在由OpenSSL版本报告。从https://github.com/curl/curl.git。下面是我使用的bash脚本片段: CD=$(pwd) CPPFLAGS="-I$CD/zlib -I$CD/openssl -I$CD/openssl/include" LDFLAGS="-L$CD/zlib -

为了在RHEL 7.3上安装最新的libcurl,修复此编译错误的正确方法是什么

我已经能够获得最新的openssl,构建并安装它<代码>OpenSSL 1.1.1-dev xx XXX xxxx现在由
OpenSSL版本
报告。从
https://github.com/curl/curl.git
。下面是我使用的bash脚本片段:

CD=$(pwd)
CPPFLAGS="-I$CD/zlib -I$CD/openssl -I$CD/openssl/include" 
LDFLAGS="-L$CD/zlib -L$CD/openssl" 
LIBS="-ldl" 
cd curl
./buildconf
./configure --disable-shared --with-zlib --with-ssl
make
make install
使用
sudo
运行批处理,
make
完成,无错误<代码>使安装产生以下结果:

  CC       libcurl_la-openssl.lo
vtls/openssl.c: In function 'Curl_ossl_seed':
vtls/openssl.c:279:5: error: implicit declaration of function 'RAND_egd' [-
Werror=implicit-function-declaration]
   int ret = RAND_egd(data->set.str[STRING_SSL_EGDSOCKET]?
   ^
cc1: some warnings being treated as errors
make[2]: *** [libcurl_la-openssl.lo] Error 1
make[2]: Leaving directory `/home/john/curl/lib'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/john/curl/lib'
make: *** [all-recursive] Error 1

编辑:更新为更干净的版本 以下是使用最新的
openssl构建
curl
的步骤

CD=$(pwd)
echo Setting up openssl
if [ ! -d openssl ]; then
    git clone https://github.com/openssl/openssl.git
    cd openssl
else
    cd openssl
    git pull
fi
# you may not need -Wl,--enable-new-dtags but it works for me
./config -Wl,--enable-new-dtags --prefix=/usr/local/ssl --openssldir=/usr/local/ssl
make depend
make 
sudo make install
cd ..

lib=zlib-1.2.11
echo Setting up zlib
if [ ! -d zlib ]; then
    wget http://zlib.net/$lib.tar.gz
    tar xzvf $lib.tar.gz
    mv $lib zlib
fi
cd zlib
./configure
make
cd ..

echo Setting up curl ...
CD=$(pwd)

if [ ! -d curl ]; then
    git clone https://github.com/curl/curl.git
    cd curl
else
    cd curl
    git pull
fi

cd curl
./buildconf
PKG_CONFIG_PATH=/usr/local/ssl/lib/pkgconfig LIBS="-ldl" ./configure --with-
zlib=$CD/zlib --disable-shared
make
# I use local curl build without installing it
# make install
cd ..

我真诚地希望这对其他人有所帮助。

编辑:更新为更干净的版本 以下是使用最新的
openssl构建
curl
的步骤

CD=$(pwd)
echo Setting up openssl
if [ ! -d openssl ]; then
    git clone https://github.com/openssl/openssl.git
    cd openssl
else
    cd openssl
    git pull
fi
# you may not need -Wl,--enable-new-dtags but it works for me
./config -Wl,--enable-new-dtags --prefix=/usr/local/ssl --openssldir=/usr/local/ssl
make depend
make 
sudo make install
cd ..

lib=zlib-1.2.11
echo Setting up zlib
if [ ! -d zlib ]; then
    wget http://zlib.net/$lib.tar.gz
    tar xzvf $lib.tar.gz
    mv $lib zlib
fi
cd zlib
./configure
make
cd ..

echo Setting up curl ...
CD=$(pwd)

if [ ! -d curl ]; then
    git clone https://github.com/curl/curl.git
    cd curl
else
    cd curl
    git pull
fi

cd curl
./buildconf
PKG_CONFIG_PATH=/usr/local/ssl/lib/pkgconfig LIBS="-ldl" ./configure --with-
zlib=$CD/zlib --disable-shared
make
# I use local curl build without installing it
# make install
cd ..

我真诚地希望这对其他人有所帮助。

RAND_egd()不再是默认OpenSSL安装的一部分。看见您可以通过在configure命令中添加
enable egd
来解决此问题。

RAND\u egd()不再是默认OpenSSL安装的一部分。看见您可以通过在configure命令中添加
enable egd
来解决这个问题。

Oh man这是我今天看到的关于libcurl不构建的第十篇文章:(可能是在VTLS/OpenSSL.C.@ Actuala84中包含了一个缺失的指令,在发布RHEL 7.3之前,我还拉过几个较老的版本,并且在RHEL上得到了类似的阻塞错误。您仍然认为这是一个CURL配置问题吗?哦,这是我今天看到的关于LBCURL不构建的第十篇文章:(可能是在VTLS/OpenSSL.C.@ Actuala84中包含了一个缺失的指令,在发布RHEL 7.3之前,我还拉过几个老版本,并且在RHEL上得到了类似的阻塞错误。您仍然认为这是一个卷曲配置问题吗?”丹尼尔斯滕贝格,而不是投票否决我的答案,您最好提供一个更正确的答案。用新的、干净的解决方案更新了我的答案,我相信你现在会投赞成票。@DanielStenberg与其否决我的答案,不如你提供一个更正确的答案。不过,我用新的、干净的解决方案更新了我的答案,我相信你现在会投赞成票。