cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: Static Linking error with mingw32

From: Aaron Oneal <aaron.oneal_at_spicypixel.com>
Date: Sat, 6 Jun 2009 09:42:14 -0700

Hi Andrei, in the application you're linking libcurl.a to, make sure you
also define CURL_STATICLIB.

-----Original Message-----
From: curl-library-bounces_at_cool.haxx.se
[mailto:curl-library-bounces_at_cool.haxx.se] On Behalf Of Andrei Gagarin
Sent: Saturday, June 06, 2009 5:18 AM
To: curl-library_at_cool.haxx.se
Subject: Static Linking error with mingw32

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