"Chris Ch" <[email protected]> wrote:

I am trying to compile a simple program which uses libcurl with Mingw using
Msys. Here is my command and the output given:

Chris@Chris-HP ~
$ gcc -L/usr/local/lib/libcurl.a -o live live.c -DCURL_STATICLIB
-I/usr/local/include -lcurl
c:/mingw/bin/../lib/gcc/mingw32/4.7.0/../../../../mingw32/bin/ld.exe:
cannot find -lcurl

The '-L' option (ld search-path) is supposed to contain a directory
(not a file). IMHO it's better to explicitly tell the linker what lib to use;

gcc -o live live.c -DCURL_STATICLIB -I/usr/local/include /usr/local/lib/libcurl.a
Since (on Windows at least), if you use '-lcurl', GNU ld will use 
'libcurl.dll.a' if both
libcurl.dll.a and libcurl.a are present in the same directory. Very annoying.

--gv
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html

Reply via email to