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