简体   繁体   中英

How properly connect libcurl to Visual Studio 2012?

I want to use in my project libcurl library. So here are steps that I did to connect libcurl library to MSVS 2012: 1. I downloaded this package from official site libcurl-7.19.3-win32-ssl-msvc.zip 2. All dll and lib files I placed in C:\\Program Files\\Microsoft Visual Studio 11.0\\VC\\lib 3. curl folder with header files i copied to C:\\Program Files\\Microsoft Visual Studio 11.0\\VC\\include 4. In VS 2012 in Project's options i added curllib.lib string 5. dll files I also copied to Project's Debug folder

But when I run this example:

int main(void)
{
CURL *curl;
  CURLcode res;

  curl = curl_easy_init();
  if(curl) {
    curl_easy_setopt(curl, CURLOPT_URL, "https://api.copy.com/oauth/request");
    /* 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));

    /* always cleanup */ 
    curl_easy_cleanup(curl);
  }
return 0
}

I get an error that there is missing libsasl.dll. What is libsasl.dll and where i should get it if there is no such file in package.

Well, I found a lot of different versions of libsasl.dll but they all were outdated. But on this forum I found advice to download OpenLDAP for Windows and use libsasl.dll from program folder. And that works!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM