centos7编译curl时发生错误

1.在编译curl时发生如下错误

make[2]: Entering directory `/software/curl/curl-7.55.1/lib'
  CC       vtls/libcurl_la-openssl.lo
vtls/openssl.c: In function ‘Curl_ossl_seed’:
vtls/openssl.c:276: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]: *** [vtls/libcurl_la-openssl.lo] Error 1
make[2]: Leaving directory `/software/curl/curl-7.55.1/lib'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/software/curl/curl-7.55.1/lib'
make: *** [all-recursive] Error 1

编译的配置参数

 ./configure --with-ssl

curl版本是7.55.1,openssl版本是1.1.0f

阅读 14k
2 个回答

http://forum.directadmin.com/... 找到了解决办法
参考zEitEr的办法
https://help.poralix.com/arti...

在其中

cd /usr/local/directadmin/scripts/
wget https://raw.githubusercontent.com/poralix/directadmin-utils/master/openssl/openssl.install-1.0.1-primary.sh
chmod 755 openssl.install-1.0.1-primary.sh
./openssl.install-1.0.1-primary.sh

需要修改一下其中的代码

#!/usr/bin/env bash
#
# by Alex Grebenschikov (www.poralix.com)
#
VER="1.1.0";
INSTALL_TO="/usr";

URL="https://www.openssl.org/source/old/${VER}/openssl-${VER}f.tar.gz"
DIR_TO="/usr/local/src";
SAVE_TO="${DIR_TO}/openssl-${VER}-latest.tar.gz";

wget ${URL} -O ${SAVE_TO};
tar -zxvf ${SAVE_TO} -C ${DIR_TO};

cd ${DIR_TO};
DIR=`ls -1d openssl-${VER}*/ | tail -1`;
cd ${DIR};

./config --prefix=${INSTALL_TO} no-ssl2 no-ssl3 zlib-dynamic -fPIC shared;
make depend && make install;

c=`grep "${INSTALL_TO}/lib" /etc/ld.so.conf -c`;
if [ "${c}" == "0" ]; then
     echo "${INSTALL_TO}/lib" >> /etc/ld.so.conf;
fi;
ldconfig

exit 0;

保存后执行,然后再次编译curl通过

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进