cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Static Linking error with mingw32

From: Andrei Gagarin <andrei.gagarin_at_gmail.com>
Date: Sat, 6 Jun 2009 14:14:05 -0600

On Sat, Jun 6, 2009 at 10:42 AM, Aaron Oneal<aaron.oneal_at_spicypixel.com> wrote:
> Hi Andrei, in the application you're linking libcurl.a to, make sure you
> also define CURL_STATICLIB.

Thanks for you reply. I think I forgot to mention that I did look at
the FAQ and did define this but it still tried to link with these
_imp*. I also tried -static but no luck. Any more ideas?

Andrei.

>
> -----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