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

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

Re: [Mingw-cross-env-list] Request for OSS support


From: Martin Lambers
Subject: Re: [Mingw-cross-env-list] Request for OSS support
Date: Fri, 15 Feb 2013 13:48:50 +0100

On Fri, 15 Feb 2013 23:26:56 +1100, Tony Theodore wrote:
> > Accordingly, shared libraries would
> > not save code space but would bring us just nearer to "shared
> > libraries hell", that of conflicting versions.
> 
> That's only if you're using "other people's" shared libraries. It's
> never been obvious to me why you can't ship all your required .dlls
> to achieve the result of "static versioning".

I think you can do that, but shipping a set of DLLs has disadvantages.

The first disadvantage is that you need to distribute a set of files
instead of a single file, and when some library deep down in the
dependency list changes its prerequisites, then this set of files
changes. So you have to keep track of the set of DLLs after each MXE
update.

The second is that if you have a tool that wants to put itself into the
PATH on Windows (one of my projects does), then you need to use
different directories for your binary and the DLLs. That's because
Windows uses PATH not only to find executables, but also to find DLLs;
there is no separate LD_LIBRARY_PATH. So if your binary directory is
in PATH and contains DLLs, then these might override the DLLs that some
other program expected to use, resulting in all sorts of problems. (We
had exactly this problem frequently with MikTex versions that put Qt
DLLs into PATH). Putting DLLs into a separate directory requires some
additional effort for your program to find them.

A while ago, I did not care much if MXE would link statically or
dynamically as long as it was easy to use, but now I think linking
statically is better on Windows, since that platform does not provide
any of the advantages that dynamic libraries typically have. You save
no disk space (everybody has to distribute their own DLLs anyway), and
there are no automatic propagated security updates or bug fixes (for
the same reason). Instead, you get additional complexity for no
benefit.

Martin



reply via email to

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