cURL / Mailing Lists / curl-library / Single Mail

curl-library

Static Linking error with mingw32

From: Andrei Gagarin <andrei.gagarin_at_gmail.com>
Date: Sat, 6 Jun 2009 06:17:41 -0600

Hello Everyone,

I am new to this list and I am new to C/C++ too. I am doing some
development with mingw32 (3.4.5); I downloaded
curl-7.19.5-devel-mingw32.zip from the download page.

Under the lib directory, each library file has one .a version and one
dll.a version.

I want to link against libcurl.a statically. I am not a mingw guru but
I had some experience with gcc/g++ on linux. I know I should use
-LPath and lcurl to link properly. Mingw found libcurl.a but it still
complains: undefined reference to `_imp__curl_global_init' and so on.

I know the _imp* are usually for dynamic libraries; so I changed lcurl
to lcurldll (it has libcurldll.a) and it worked. I throw all the dlls
with the package in and my program worked.

I want to use the static .a libraries. Did I miss something?

Thanks very much.
Andrei
Received on 2009-06-06