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://google.com");
res = curl_easy_perform(curl);
/* always cleanup */
curl_easy_cleanup(curl);
}
return 0;
}
显然它没有找到CURL_STATICLIB,我不知道为什么。 我甚至不确定是否需要将CURL_STATICLIB添加到我的链接器设置中(我在其他论坛上读到过)。 我发现有些人遇到了同样的问题,但是没有任何地方得到了恰当的答案:
我很厌倦与此作斗争,请帮帮我。stackoverflow.com/questions/4176503/frustrated-with-libcurl
forums.codeblocks.org/index.php?topic=11391.0
old.nabble.com/gcc-working-with-libcurl-td20506927.html
forums.devshed.com/c-programming-42/linker-error-using-libcurl-698071.html
编辑:
你好,维克多,谢谢回复!
我会尽可能详细,以免误解。 所以,这是我的C:\libs\文件夹的目录树图像:
http://img199.imageshack.us/img199/6977/curl1.png
如您所见,它还包括构建日志,您会注意到这次的错误与我之前发布的不同。这是因为我更改了全局编译器和构建项目设置。我的新构建项目设置:http://img863.imageshack.us/img863/4404/buildoptions.png 我的新全局编译器设置:http://img225.imageshack.us/img225/4926/curl2.png 我确信我配置这些设置时出错了,这就是为什么我无法编译它的原因。