C++ 将Curl链接到Windows上的代码块
我正在使用Win7x64并下载 我在buildoptions->linker settings中将库*.a文件从curl/lib64添加到我的项目中 添加到搜索目录->编译器/curl/include目录。 我正在尝试编译示例代码:C++ 将Curl链接到Windows上的代码块,c++,curl,linker,codeblocks,libcurl,C++,Curl,Linker,Codeblocks,Libcurl,我正在使用Win7x64并下载 我在buildoptions->linker settings中将库*.a文件从curl/lib64添加到我的项目中 添加到搜索目录->编译器/curl/include目录。 我正在尝试编译示例代码: #include <stdio.h> #include <curl\curl.h> int main(void) { curl_global_init( CURL_GLOBAL_ALL ); CURL * myHandle; CURLc
#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)) ===|*
我不知道该怎么做才能让它工作 好的,根据我读的另一篇文章,我试着链接32x lib,瞧,它起作用了。你应该给出链接,或者应该写更多