windows x86/x64 pre-built devel libraries

226 views
Skip to first unread message

dissertat...@gmail.com

unread,
Nov 3, 2015, 11:40:12 PM11/3/15
to SpatiaLite Users

Are there Windows pre-built development libraries for the latest version 4.3? The pre-built binaries available for download here


and 


don't seem to have the import libraries (.lib). I tried creating my own import libraries for mod_spatialite.dll using dumpbin/lib but that DLL doesn't seem to export all the functions. For example, spatialite_init_ex and spatialite_cleanup_ex are not there. Is there a dll pre-built with all the functions exported and import library available? I tried building the library with partial success. I could get spatialite.dll to build but the GEOS dependent functions were giving strange results.



a.fu...@lqt.it

unread,
Nov 4, 2015, 2:53:39 AM11/4/15
to spatiali...@googlegroups.com
On Tue, 3 Nov 2015 20:40:12 -0800 (PST), dissertat...@gmail.com
wrote:
> Are there Windows pre-built development libraries for the latest
> version 4.3?
>

the SpatiaLite project directly distributes binary executables
for Windows platforms (both 32 and 64 bit), anyway _only_ the
dynamically loadable extension module (mod_spatialite) is
supported, not the classic linkable library.


> The pre-built binaries available for download here
>
> http://www.gaia-gis.it/gaia-sins/windows-bin-amd64/
>
> and
>
> http://www.gaia-gis.it/gaia-sins/windows-bin-x86/
>
> don't seem to have the import libraries (.lib).
>

1. our Windows binaries are always built using the MinGW
compiler, not MSVC, and .lib objects are non-standard
objects required only by MSVC.
2. mod_spatialite is a pure loadable module, not a classic
dynamic library. you can never directly link mod_spatialite,
you absolutely need to call the SQLite's own "load_extension"
API in order to dynamically load the module at run-time.


> I tried creating my
> own import libraries for mod_spatialite.dll using dumpbin/lib but
> that
> DLL doesn't seem to export all the functions. For example,
> spatialite_init_ex and spatialite_cleanup_ex are not there.
>

exactly: this simply is because mod_spatialite is a pure
loadable module. it's a DLL, but a someway special DLL just
exporting external symbols expected by "load_extension";
if you are searching for a classic library exporting all
link symbols it's libspatialite, not mod_spatialite.
You can read more technical details from here:

https://www.gaia-gis.it/fossil/libspatialite/wiki?name=mod_spatialite


> Is there a dll pre-built with all the functions exported and import
> library available?
>

yes, please look at the OSGeo4W distribution:
http://trac.osgeo.org/osgeo4w/
it's slightly outdated, but it's specifically intended to
support MSVC C/C++ developers.
the SpatiaLite project itself does not supports MSVC in any
way simply because this will add too much further complexity.


> I tried building the library with partial success. I could
> get spatialite.dll to build but the GEOS dependent functions were
> giving strange results.
>

a. the simpler and easier solution on Windows is building
libspatialite (and all required dependencies) using
the MinGW compiler. here you can find several useful hints:
http://www.gaia-gis.it/gaia-sins/mingw_how_to.html
http://www.gaia-gis.it/gaia-sins/msvc_how_to.html

b. the harder solution is building libspatialite (and all
related dependencies) using the MSVC compiler.
it could probably be a really difficult task and will
surely require a long time.

c. a very reasonable alternative solution is to adapt
to MSVC the usual strategy adopted by Java, .NET,
Python, PHP and many other languages, i.e. just
loading mod_spatialite at run time by executing
a "load_extension" SQLite call immediately after
establishing a DB connection.

bye Sandro
Reply all
Reply to author
Forward
0 new messages