|
From: | Nikos Chantziaras |
Subject: | Re: [Mingw-cross-env-list] MXE: How to build a self-sufficient DLL that statically includes other libraries? |
Date: | Fri, 27 Mar 2015 22:55:11 +0200 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 |
On 27/03/15 10:59, Matthias Geier wrote:
In case somebody is interested: I found a solution! After a lot of experimenting and searching the web, I finally found out that it's actually quite simple. Static libraries can be converted to DLLs with gcc (which in turn calls ld) using the -shared flag. Without this flag, gcc would try to make an .exe file, which wouldn't work because there is no main function (and besides, I don't want an .exe file anyway). The essential part, which took me quite a while to find out, is to use the option -Wl,--whole-archive; otherwise the generated DLL will be essentially empty!
That is very useful!And I just found out what the difference was between you and me: I didn't specify the "--enable-external-libs" configure option. I simply removed the "--disable-external-libs" option instead, wrongly assuming that this enables external libraries (vorbis, flac). It doesn't, so I wasn't getting any errors.
[Prev in Thread] | Current Thread | [Next in Thread] |