mingw-cross-env-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Mingw-cross-env-list] MXE: How to build a self-sufficient DLL that stat


From: Matthias Geier
Subject: [Mingw-cross-env-list] MXE: How to build a self-sufficient DLL that statically includes other libraries?
Date: Tue, 24 Mar 2015 11:51:38 +0100

Dear list.

I repeatedly saw the recommendation on this list to either build
everything shared or everything static:

http://lists.nongnu.org/archive/html/mingw-cross-env-list/2009-09/msg00025.html
http://lists.nongnu.org/archive/html/mingw-cross-env-list/2010-10/msg00055.html
http://lists.nongnu.org/archive/html/mingw-cross-env-list/2011-06/msg00056.html

This makes a lot of sense in general, but I have a specific case where
I would like to mix static and shared libraries.
I would like to create a DLL for libsndfile, which should statically
include all dependencies (libFLAC, libogg, libvorbis, ...).

The reason for that is that I do *not* want to create an EXE that
links to the library (be it statically or dynamically), but I want to
use the DLL directly from within Python using CFFI
(https://cffi.readthedocs.org/).

When I build everything as dynamic libraries (which works great with
"make libsndfile MXE_TARGETS=x86_64-w64-mingw32.shared") and put all
the DLLs into the same directory, CFFI tries to load the primary DLL
(libsndfile-1.dll), but the other DLLs (e.g. libFLAC-8.dll) cannot be
found.

I tried to add --enable-shared to src/libsndfile.mk and build the rest
as static libraries (with "make libsndfile
MXE_TARGETS=x86_64-w64-mingw32"), but this leads to warnings like this
(and afterwards to many linker errors):

*** Warning: This system can not link to static lib archive
[...]/usr/x86_64-w64-mingw32/lib/libvorbis.la.
*** I have the capability to make that library automatically link in when
*** you link to this library.  But I can only do this if you have a
*** shared version of the library, which you do not appear to have.

According to some messages on this list (especially regarding
GTK/Glade), it seems to be possible (though not recommended) to mix
static and dynamic libraries.

Can somebody please give me a hint how I might be able to do this for
libsndfile?

cheers,
Matthias



reply via email to

[Prev in Thread] Current Thread [Next in Thread]