On Thu, 2 Dec 2021 03:09:08 -0800 (PST), Bojan Vukasovic wrote:
> I managed to do smth with this command:
>
> ----------- <snip> ------------------
>
> It produces mod_spatialite.dll and it has ~27MB.
>
> The problem is that it fails to be loaded as an extension.
>
> P.S. in order to compile this, I had to use "./s.o" which has only
> WinMain inside (otherwise I got complain that it is missing WinMain).
>
Hi Bojan,
attempting to build a monolithic copy of mod_spatialite (i.e. one
statically linked to all its dependencies is intrinsically bad for
at least two reasons:
1. technically speaking, mod_spatialite is a dynamically loadable
module, that is to say a sw compoment intrinsically designed
for dynamic loading.
introducing static linkage in this overall architecture is
like putting a massive medieval castle on the flimsy roof of
a greenhouse ... not the most elegant solution I can think of
2. (even more serious) I suppose that you intend to deploy
mod_spatialite on Java or may be on Python.
Be warned: using static linkage in such environments is
a sure recipe for disaster, because you are seriously
risking to load at run time conflicting vesions of the
same libraries (one dynamically linked and the other
statically linked), may be compiled by different compilers,
a very dangerous condition leading to frequent instabilities
and unexpected crashes.
> The problem is that it fails to be loaded as an extension.
>
> P.S. in order to compile this, I had to use "./s.o" which has only
> WinMain inside (otherwise I got complain that it is missing WinMain).
>
please note: mod_spatialite isn't a DLL as any other, it's a
dynamically loadable module, that is a completely different
thing. you must absolutely specify the -module option to the
linker in order to get a dynamically loadable module instead
of the most usual DLL
bye Sandro