cURL / Mailing Lists / curl-library / Single Mail

curl-library

Linker errors with MinGW on WinXP

From: Tyler Knott <mr_radar_at_charter.net>
Date: Sat, 24 Apr 2004 16:49:59 -0500

I'm trying to write a program that involves downloading a file off the
internet if it can't find it locally. libcurl seemed to be easy enough
to use and good enough to do the job without a lot of work, however I
can't get my program to compile with the libcurl code added. Here is
the code:

#include <curl/curl.h>
...
CURL * easyhandle;
CURLcode success;
...
curl_global_init(CURL_GLOBAL_WIN32);
easyhandle = curl_easy_init();
curl_easy_setopt(easyhandle, CURLOPT_URL,
"http://www.stanford.edu/group/pandegroup/release/FAH4Console.exe");
curl_easy_setopt(easyhandle, CURLOPT_FILE, FAH_out);
curl_easy_perform(easyhandle);
curl_easy_cleanup(easyhandle);
curl_global_cleanup();

I get the following errors when I try to compile:
C:\DOCUME~1\TYLERK~1\LOCALS~1\Temp/ccM3aaaa.o(.text+0x67d):folding-at-once.c:
undefined reference to `curl_global_init'
C:\DOCUME~1\TYLERK~1\LOCALS~1\Temp/ccM3aaaa.o(.text+0x685):folding-at-once.c:
undefined reference to `curl_easy_init'
C:\DOCUME~1\TYLERK~1\LOCALS~1\Temp/ccM3aaaa.o(.text+0x69d):folding-at-once.c:
undefined reference to `curl_easy_setopt'
C:\DOCUME~1\TYLERK~1\LOCALS~1\Temp/ccM3aaaa.o(.text+0x6b6):folding-at-once.c:
undefined reference to `curl_easy_setopt'
C:\DOCUME~1\TYLERK~1\LOCALS~1\Temp/ccM3aaaa.o(.text+0x6c4):folding-at-once.c:
undefined reference to `curl_easy_perform'
C:\DOCUME~1\TYLERK~1\LOCALS~1\Temp/ccM3aaaa.o(.text+0x6d2):folding-at-once.c:
undefined reference to `curl_easy_cleanup'
C:\DOCUME~1\TYLERK~1\LOCALS~1\Temp/ccM3aaaa.o(.text+0x6da):folding-at-once.c:
undefined reference to `curl_global_cleanup'
Received on 2004-04-24