最近、Dev-C++ インストールに含まれている Packman.exe を使用して、Dev-C++ に cURL ライブラリをインストールしました。使用しようとする#include <curl/curl.h>
とエラーが発生しないため、正しくインストールされていると想定しています。ただし、cURL Web サイトから例をコンパイルしようとすると、次のエラーが発生します。
[Linker error] undefined reference to _imp__curl_easy_init
[Linker error] undefined reference to _imp__curl_easy_setopt
[Linker error] undefined reference to _imp__curl_easy_perform
[Linker error] undefined reference to _imp__curl_easy_cleanup
私が使用しているソースコードは次のとおりです。
#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://example.com");
res = curl_easy_perform(curl);
curl_easy_cleanup(curl);
}
return 0;
}
ありがとうございました!:)