• libCurl的C++引用


    I believe I have gotten LibCurl to work with Visual Studio 2013 now. Persistence ftw! Although, after spending hours trying to solve these error messages, I am a little hesitant at saying everything is working fine now. That is why I am putting a bounty on this question to get clear and conciseinstructions on getting LibCurl to work with Visual Studio 2013.

    This is what I did to get it to work:

    1. First, download the Win32 MSVC package here: http://curl.haxx.se/download.html#Win32 For these instructions sake, let's say you downloaded to C:LibCurl

    2. Start a new project in Visual Studio. Go to Project|Project Properties|VC++ Directories|Include Directories| Add the path to the include directory inside the downloaded package. (C:LibCurlinclude)

    3. Next, go to Project|Project Properties|Linker|General|Additional Library Directories| Add the path to the lib directory. (Where curllib.dll is located)

    4. Then, go to Project|Project Properties|Linker|Input|Additional Dependencies| And add curllib.lib

    5. Now if you compile a test program, you will likely get the message saying libsasl.dll is missing. You will need to download this file and put it in the same directory as your build. I used 7-Zip to extract libsasl.dll from OpenLDAP for WindowsOpenLDAP for Windows

    This is the result of my test code from above: 

    ------------配置好后,将dl放置到对应的目录下--------------------

    示范代码

    #include <iostream>
    #include <stdio.h> 
    #include <curl/curl.h> 
    
    
    int main(void)
    {
        CURL *curl;
        CURLcode res;
    
        curl = curl_easy_init();
        if (curl) {
            curl_easy_setopt(curl, CURLOPT_URL, "http://www.baidu.com");
            res = curl_easy_perform(curl);
    
            /* always cleanup */
            curl_easy_cleanup(curl);
        }
        return 0;
    }
  • 相关阅读:
    如何提取一个转录本的3'UTR区域的序列
    如何研究某个gene的ceRNA 网络
    ceRNA 调控机制
    利用circpedia 数据库探究circRNA的可变剪切
    R语言低级绘图函数-symbols
    R语言低级绘图函数-grid
    R语言低级绘图函数-axis
    R语言低级绘图函数-title
    R语言低级绘图函数-points
    二叉树和二叉查找树之间的区别
  • 原文地址:https://www.cnblogs.com/micro-chen/p/5961195.html
Copyright © 2020-2023  润新知