我在用curl进行URL调用时遇到了问题。
首先在curl版本7.40.0中声明curl.h文件
#include "curl.h" // curl-7.40.0在调用curl的函数中。
CURL *curl = curl_easy_init();
CURLcode res;
curl_easy_setopt(curl, CURLOPT_URL,"https://www.google.com");
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, TURE);
res = curl_easy_perform(curl);执行上述代码时,会发生以下错误
中不支持或禁用的
同样,当我在Linux控制台中使用curl命令运行它时,它将正常运行。(卷曲版本7.19.7)
curl https://www.google.com你能告诉我有什么问题吗?
谢谢!
发布于 2021-01-07 08:01:20
更新您的系统
sudo apt update
安装curl所需的任何构建依赖项。
sudo apt-get build-dep curl
检查版本
curl-config --version
# (maybe here you have 7.69-xxx)
curl --version
# 7.68.0检查路径正确
which curl
# /usr/local/bin/curl
whereis curl
# curl: /usr/bin/curl /usr/local/bin/curl /usr/share/man/man1/curl.1.gz
export LD_LIBRARY_PATH=/usr/local/lib安装LIB以获得相同的版本
mkdir ~/curl
cd ~/curl
wget http://curl.haxx.se/download/curl-7.68.0.tar.bz2
tar -xvjf curl-7.68.0.tar.bz2
cd curl-7.68.0/
./configure
make
sudo make install
sudo ldconfig检查您有相同的版本
curl-config --version
curl --versionhttps://stackoverflow.com/questions/63006504
复制相似问题