cURL / Mailing Lists / curl-library / Single Mail


Réf. : Re[2]: Linker error, Dev-C++, Windows XP

From: Philippe HAMEAU <>
Date: Mon, 5 Feb 2007 11:33:01 +0100

You could also got to the project properties to add curl as a used
library. Dev C++ will do the job of adding -lcurl to gcc for you.


Envoyé par :
04/02/2007 11:44
Veuillez répondre à furs22; Veuillez répondre à libcurl development
Remis le : 04/02/2007 12:20

        Pour : "James Buchanan" <>, "libcurl development"
        cc : (ccc : Philippe HAMEAU/DRD/SAGEM)
        Objet : Re[2]: Linker error, Dev-C++, Windows XP

>> I'm beginner. I tried to compile simple source code using libcurl. I
>> downloaded Dev-C++ and libcurl for Windows. I copied catalog 'curl',
>> which was in libcurl archive to 'Dev-C++\include'.
>> Must I do sth else?
>> Then I tried compile 'simple.c' which is in libcurl archive:
>> Compiler:
>> [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'
>> ld returned 1 exit status
>> Compile log:
>> Compiler: Default compiler
>> Executing gcc.exe...
>> gcc.exe "D:\Programy\libcurl-7.16.0\docs\examples\simple.c" -o
"D:\Programy\libcurl-7.16.0\docs\examples\simple.exe" -I"C:\Dev\include"
>> D:\DOCUME~1\Spearow\USTAWI~1\Temp/ccSSbaaa.o(.text+0x2b):simple.c:
undefined reference to `_imp__curl_easy_init'
>> D:\DOCUME~1\Spearow\USTAWI~1\Temp/ccSSbaaa.o(.text+0x51):simple.c:
undefined reference to `_imp__curl_easy_setopt'
>> D:\DOCUME~1\Spearow\USTAWI~1\Temp/ccSSbaaa.o(.text+0x5e):simple.c:
undefined reference to `_imp__curl_easy_perform'
>> D:\DOCUME~1\Spearow\USTAWI~1\Temp/ccSSbaaa.o(.text+0x6e):simple.c:
undefined reference to `_imp__curl_easy_cleanup'
>> collect2: ld returned 1 exit status
>> Execution terminated
>> I don't know what path is this:
>> 'D:\DOCUME~1\Spearow\USTAWI~1\Temp/ccSSbaaa.o'.
>> What I'm doing wrong?

> It seems that the linker is looking for the curl library. Before you
> can write curl programs, you have to compile curl itself so the
> libcurl library is available for curl programs to link with. Or make
> the library available to the program, for example if you have the
> libcurl library as a binary that came with another program in MinGW or
> Cygwin for example.

> James

Thanks for your answer :) I know now how do this, but it's not too
gcc -DCURL_STATICLIB -c -g -Icurl/include simple.c
gcc -o simple.exe simple.o -Lcurl/lib -lcurl -lws2_32 -lwinmm


" Ce courriel et les documents qui y sont attaches peuvent contenir des informations confidentielles. Si vous n'etes pas le destinataire escompte, merci d'en informer l'expediteur immediatement et de detruire ce courriel ainsi que tous les documents attaches de votre systeme informatique. Toute divulgation, distribution ou copie du present courriel et des documents attaches sans autorisation prealable de son emetteur est interdite."

" This e-mail and any attached documents may contain confidential or proprietary information. If you are not the intended recipient, please advise the sender immediately and delete this e-mail and all attached documents from your computer system. Any unauthorised disclosure, distribution or copying hereof is prohibited."
Received on 2007-02-05