[英]How properly connect libcurl to Visual Studio 2012?
我想在我的項目libcurl庫中使用。 因此,這是我將libcurl庫連接到MSVS 2012的步驟:1.我從官方網站libcurl-7.19.3-win32-ssl-msvc.zip下載了此軟件包。2 .所有放置在C:\\中的dll和lib文件。 Program Files \\ Microsoft Visual Studio 11.0 \\ VC \\ lib 3.將帶有頭文件的curl文件夾復制到C:\\ Program Files \\ Microsoft Visual Studio 11.0 \\ VC \\ include 4.在VS 2012中,在Project的選項中,我添加了curllib.lib字符串5我還復制了.dll文件到Project的Debug文件夾
但是當我運行此示例時:
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
}
我收到一個錯誤,提示缺少libsasl.dll。 什么是libsasl.dll?如果軟件包中沒有這樣的文件,我應該在哪里獲取它。
好吧,我發現了很多不同版本的libsasl.dll,但是它們都已經過時了。 但是在這個論壇上,我找到了下載Windows版OpenLDAP並從程序文件夾中使用libsasl.dll的建議。 那行得通!
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.