0
点赞
收藏
分享

微信扫一扫

QT MINGW使用编译使用libcurl库

静鸡鸡的JC 2022-03-10 阅读 93

1.下载libcurl源码    curl - Download

2.解压源代码进入lib目录

 3.在lib目录运行黑框,执行  mingw32-make.exe -f Makefile.m32  命令(使用mingw32-make.exe要配置环境变量,即QT安装目录下的mingw32-make.exe)

4.编译成功后生成lib  .a文件

5.添加外部库,并复制curl源代码include的curl目录下的.h文件到工程

 

 6.测试程序,需包含curl.h头文件

    CURL *curl = curl_easy_init();
    if(curl) {
      CURLcode res;
      curl_easy_setopt(curl, CURLOPT_URL, "http://www.baidu.com");
      res = curl_easy_perform(curl);
      curl_easy_cleanup(curl);
    }

 7.测试成功

 

举报

相关推荐

0 条评论