编译libcurl

参考:http://blog.csdn.net/yannanxiu/article/details/56841726
1.libcurl的应用举例:

#include <stdio.h>  
#include <curl.h>    

#pragma comment(lib,"libcurld.lib")  

int main(int argc, char* argv[])

{

    CURL *curl;
    CURLcode res;

    curl = curl_easy_init();

    if (curl) {
        curl_easy_setopt(curl, CURLOPT_URL, "http://www.baidu.com");
        /* example.com is redirected, so we tell libcurl to follow redirection */
        curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);

        /* Perform the request, res will get the return code */
        res = curl_easy_perform(curl);
        /* Check for errors */
        if (res != CURLE_OK)
            fprintf(stderr, "curl_easy_perform() failed: %s\n",
                curl_easy_strerror(res));
        system("pause");
        /* always cleanup */
        curl_easy_cleanup(curl);
    }
    return 0;
}
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • Android 自定义View的各种姿势1 Activity的显示之ViewRootImpl详解 Activity...
    passiontim阅读 175,430评论 25 709
  • 在此特此声明:一下所有链接均来自互联网,在此记录下我的查阅学习历程,感谢各位原创作者的无私奉献 ! 技术一点一点积...
    远航的移动开发历程阅读 13,872评论 12 197
  • 今天卓姐姐生日,想了一天都没想好送什么礼物给她,想着晚上吃饭逛街的时候买点实用的东西。 银泰城碰面,就我俩,吃了东...
    W大步溜阅读 1,475评论 0 0