0
我使用Win7x64和下載libCurl鏈接捲曲的代碼塊在Windows
我構建選項 - 添加庫* .a文件從捲曲/ lib64下到我的項目>連接器的設置
添加到搜索目錄 - >編譯器/curl/include目錄。 我試圖編譯示例代碼:
#include <stdio.h>
#include <curl\curl.h>
int main(void)
{
curl_global_init(CURL_GLOBAL_ALL);
CURL * myHandle;
CURLcode result;
myHandle = curl_easy_init () ;
curl_easy_setopt(myHandle, CURLOPT_URL, "http://www.example.com");
result = curl_easy_perform(myHandle);
curl_easy_cleanup(myHandle);
printf("LibCurl rules!\n");
return 0;
}
而且我得到了錯誤:
*||=== Build: Debug in test (compiler: GNU GCC Compiler) ===| obj\Debug\main.o||In function main':| D:\Projects\test\main.cpp|6|undefined reference to _imp__curl_global_init'| D:\Projects\test\main.cpp|9|undefined reference to _imp__curl_easy_init'| D:\Projects\test\main.cpp|11|undefined reference to _imp__curl_easy_setopt'| D:\Projects\test\main.cpp|12|undefined reference to _imp__curl_easy_perform'| D:\Projects\test\main.cpp|13|undefined reference to _imp__curl_easy_cleanup'| ||=== Build failed: 5 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|*
我不知道我應該怎麼辦得到它的工作。
你應該給鏈接或應該寫更多 – Eka