On Fri, 1 Sep 2017 05:44:40 -0700 (PDT), Saeed wrote:
> Hi everybody
>
>
>
> I am new in programming, and I want to use SpatiaLite library.
>
>
>
> I have been using Postgre/postGIS for a long time; however, I
> recently
> decided to switch to SpatiaLite. I download 'mod_spatialite'
> libraries package. It contains some dll files, and I put all dlls
> near
> my database file, and it was perfectly worked;
>
Hi Saeed,
placing the DDLs in the same directory where the database is may
casually work sometimes, but does not necessarily matches the
standard searching rules adopted by Windows:
1. DLLs are searched first in the same directory from where the
calling executable (*.exe) has been loaded.
2. if the previous step fails then the DLLs are searched in
system directories such as C:\Windows\System32
3. if not yet found then the DLLs are searched in the
current directory
4. a final attempt to locate the DLLs will be done by
searching all the directories listed in the PATH
environment variable.
the simpler and safer option usually is the one to place
all depending DLLs into the same directory where is
installed the calling application (*.exe).
note: a 32 bit application can only load 32 bit DLLs,
exactly as 64 bit apps strictly require 64 bit DLLs.
any attempt to mix 32 and 64 bit binary code is always
strictly forbidden, and will usually end up in an
error message "The specified module could not be found".
> however, I want to use SpatiaLite library for some reasons.
>
which reasons ?
could you explain better this specific point ?
recent versions of SpatiaLite come in two different
flavors, mod_spatialite and libspatialite.
both are exactly the same, and simply differ in
the expected way to be loaded and activated:
- mod_spatialite is specifically intended to be
loaded by executing a "SELECT load_extension()"
SQL statement.
- libspatialite is specifically intended to be
statically or dynamically linked into a C/C++
application (*.exe)
- you can never load libspatialite via the
"SELECT load_extension()" call exactly as
you can never link mod_spatialite to a C/C++
application; they are mutually exclusive.
please read this Wiki page for more details:
https://www.gaia-gis.it/fossil/libspatialite/wiki?name=mod_spatialite
> There are so many dll packages which make me confused.
>
there is just one "dll package" for each version of
SpatiaLite, and it's the universal "mod_spatialite".
"libspatialite" could just interest C/C++ developers
and isn't part of the standard binary distribution
for Windows (it was supported in very archaic versions,
but it's now unsupported).
at the current state of the art you can choose
between the following Windows packages:
http://www.gaia-gis.it/gaia-sins/windows-bin-x86/mod_spatialite-4.3.0a-win-x86.7z
Windows 32 bit mod_spatialite version 4.3.0a
a little bit obsolete but still usable
http://www.gaia-gis.it/gaia-sins/windows-bin-amd64/mod_spatialite-4.3.0a-win-amd64.7z
same as the above one but 64 bit
http://www.gaia-gis.it/gaia-sins/windows-bin-x86-test/mod_spatialite-4.4.0-RC0-win-x86.7z
Windows 32 bit mod_spatialite version 4.4.0-RCO
the most recent: warmly recommended
http://www.gaia-gis.it/gaia-sins/windows-bin-amd64-test/mod_spatialite-4.4.0-RC0-win-amd64.7z
same as the above one but 64 bit
Never ever try to use anything older than the
above ones; any previous version (including
4.2.0) should be now considered obsolete and
deprecated.
bye Sandro