cURL / Mailing Lists / curl-library / Single Mail

curl-library

Compiling libcurl staticly within DLL-module with mingw32

From: Alexander Tumin <itakingiteasy_at_gmail.com>
Date: Sat, 20 Aug 2011 14:46:33 +0400

Hello, i am having troubles compiling libcurl staticly into dll-module
(aka plugin) with mingw32.

Here is the simple testcase illustrating the problem:
http://touhou.ru/upload/7f5f968d62f9a4f83e60f48d76bb694b.zip

 As you can see in Makefile; module.c is compiled twice:
 * once linked staticly with libstatic_curl.a and
 * once linked dynamicly with libcurl-4.dll

 There is no problems with dynamic build - it just works perfectly as expected.

 The problem is that when it is linked staticly: all module's symbols
becomes completely inaccessible with
 GetProcAddress() function from <windows.h> - it just returns NULL for anything.

 What the possible reason of such behaviour? How it can be fixed?

 Thanks.

 P.S. There is no problems with linking libcurl staticly with native
 linux GCC, in .so format, both dynamic and static linking works:
http://touhou.ru/upload/bebf73514ee48b0526b7ff6de1719b8e.zip
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2011-08-20