On Thu, 28 Jul 2016 00:29:29 -0400, Stephen Woodbridge wrote:
> Mark,
>
> Yes, I have read mingw64_how_to.html do and been reading lots of
> other docs on the site. There is a lot to absorb! Anyway, I missed
> the
> fact I needed to use librasterlite2, in part because it was not
> linked
> to the main page, or I just missed it. It compiles and installs ok -
> yeah!
>
> One of the things I'm trying to do is build based on install all of
> the dependencies that I can via pacman. I'm not sure if this is a
> good
> or bad thing to do long term. Since my goal is to build a standalone
> tool(s) that is easy to deploy, when I'm done I would like to be able
> to package up just the exe and dll's need and not have to have users
> install msys or mingw at all.
>
> I'm still working my way through things. I normally work on Linux so
> msys is kind of new to me. I used cygwin years ago, and have ported
> code to msys environment that someone set up in the past, but never
> had to set it up myself and figure out how to deploy it.
>
Hi Stephen,
all ./configure scripts are usually intended for Linux or for
other *nix derivatives, as e.g. Mac OS X.
Windows is a completely unrelated platform presenting many strong
differences: just to say, it's not fully POSIX compliant.
so if you wish to build your own binaries on Windows using the
canonical ./configure approach you surely need to use some special
tool acting as a "bridge" between *nix and Windows:
- cygwin is a complete abstraction layer implementing full
POSIX compatibility and supporting all *nix standard
commands (ls, vi, make, gcc and so on).
its main disadvantage is that any binary built on cygwin
will then require full cygwin support at run time, so you
necessarily have to install the whole cygwin on any PC
where you intend to deploy your own software.
unhappily cygwin is rather complex and heavy, so this
one is not a viable solution.
- MinGW / MSYS are a simpler and more effective cygwin
derivative; they don't rely on full POSIX, they rely
instead on native Windows API whenever is possible.
so any binary built using MinGW / MSYS can directly
run on the standard Windows run-time and will not
require installing any other "intermediate" component
as in the case of cygwin.
short conclusion: building on cygwin exactly is the
same as building on any other *nix.
but building on MinGW+MSYS still continue to be
building on an "exotic" non-POSIX platform presenting
many possible pitfalls and hidden traps.
just to enumerate the most obvious:
- in many cases POSIX APIs are not supported on Windows,
or are supported but in a slightly different way
(different names, different arguments and so on)
- in other cases Windows has its own native APIs that
are completely different from POSIX: this is the case
e.g. of WinSockets, of the Threading API and so on.
just to say, your problems about libldl are quickly
explained once you know that Windows has its own
native APIs for dynamically loading DLLs, so there
is no need at all to use -ldl on Windows.
- last but not least: on Linux the most obvious
option is building your own packages using as
far as possible dynamic linkage.
at the opposite on Windows a very common option
is building self-contained packages fully based
on static linkage, so to avoid the infamous
"DLL hell".
as a general rule, you can never expect to build on
MinGW / MSYS in the same identical way you'll usually
follow on Linux, because very often specifying some
fancy ./configure setting will be strictly required.
SpatiaLite actively supports a fully detailed and
frequently updated how-to guide about building Windows
binaries using MinGW/MSYS, in both 32 and 64 versions:
http://www.gaia-gis.it/gaia-sins/mingw_how_to.html
http://www.gaia-gis.it/gaia-sins/mingw64_how_to.html
anyway all MinGW/MSYS recipes are expected to successfully
work only if you verbatim follow the instructions from
the very beginning to the end.
I notice that you are currently using many pre-built
packages distributed by pacman.
I don't think this could be a good idea, because this
way you'll lost full control about the build workflow
as a whole including the most fine grained details.
and it could possibly contribute to inadvertently do
some trivial mistake, as the following one:
> cd libspatialite-4.3.0a
> ./configure --target=mingw64
> make
> ld.exe: cannot find -ldl
>
if you carefully check the how-to guide about MinGW-64
you'll discover that the expected argument is
"--target=mingw32", even when using the 64 bit compiler;
this will effectively trigger the Windows native API
support, and will discard any reference to -ldl
"--target=mingw64" simply is an unrecognized option,
and will have absolutely no action.
bye Sandro