[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Mingw-cross-env-list] Static vs. shared libraries (was: gtkmm suppo
From: |
Martin Lambers |
Subject: |
Re: [Mingw-cross-env-list] Static vs. shared libraries (was: gtkmm support) |
Date: |
Sun, 20 Sep 2009 21:18:11 +0200 |
User-agent: |
Mutt/1.5.18 (2008-05-17) |
On Sat, 19. Sep 2009, 19:46:16 +0200, Volker Grabsch wrote:
> What is your general opinion about static/shared libs?
> What is your concrete practical need?
On Windows, I prefer static libraries because they are so simple to use;
I just don't want to invest the time to sort out DLL issues. If there
was a way to use DLLs in a similarly simple way, that would be ok for
me, too. Package size is not important to me.
> With GTK it is a bit more complicated. It depends on many other
> libraries such as zlib (via libpng). For instance, if we build
> GTK as shared library and zlib as static library, the final
> application will not be able to use the zlib directly, because
> zlib would be included in the GTK DLL file as well as the EXE
> file, resulting in duplicate code, duplicate symbols and finally
> in fatal linker errors.
You can avoid this in special cases by putting
"-Wl,--allow-multiple-definition" into LDFLAGS (I currently do this when
using the precompiled MinGW Qt DLLs which include zlib). But this is
not a good idea if you cannot be sure that the two versions of the
symbols are compatible...
> Conclusion
I would prefer option (A), too.
Thanks for your nice summary!
Martin