You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Can I load the spatialite extension module? I have attempted using "Load extension" but I got "Error loading extension: The specified module could not be found".
As a thought, which OS are you using, and which version of DB4S and the SpatiaLite extension? (not sure if it makes a difference, but it's helpful to know)
I am not sure that I am properly using the application .. I was not able to find documentation on the "load extension". However, to reproduce my error, I open DB4S, then I create a dummy table and I try to "load extension" selecting the dll in a folder where I unzipped the 7z archive:
I ran into this same issue and I finally got it to work. It has to do with the library search paths on Windows because mod_spatialite in turn loads its own dependent DLLs that reside in the same directory as mod_spatialite.dll.
I got it working 2 different ways:
1.) Add the directory containing the spatialite .dll files to your %PATH%. Windows searches %PATH% for dll files so it will be able to locate it.
2.) Copy the .dll files to the same directory containing DB Browser for SQLite.exe. e.g. C:\Program Files\DB Browser for SQLite or C:\Program Files (x86)\DB Browser for SQLite whichever version you have installed (32bit or 64bit). You will also want to make sure you use the correct x86 or x64 dll files that correspond to the version of sqlitebrowser you have.
This works because Windows searches for .dll files in %PATH% and the current application directory. So putting them in either place works.
If mod_spatialite were shipped as fat binary containing everything in a single dll file I don't believe this would be necessary and it would just work pointing it at the dll, but until then we have to make sure all of the .dll's are located somewhere Windows will search when loading shared libs.
Any interest in cutting-n-pasting that into a wiki page, for better visibility of the info? It's seems like pretty arcane knowledge that others would definitely benefit from.
I think this issue can be closed because it's definitely not an issue with DB4S. I don't believe there's anything to be done other than making a more location-independent build of mod_spatialite.
Sqflite uses whatever the platform (Android, iOS) provides (tekartik/sqflite#70 (comment)). I am not sure if it will be possible to load spatialite under these circumstances, even if dart:ffi seems to let me run c code. Will have to try, I guess.
@chrisjlocke I did the steps you described, saved and ran Select spatialite_version() but i got an error saying its not loaded and it won't 'persist' as an extension - disappears every time I close db browser
Doesn't work here, same error as mentions 100s of times before.
Testing with nighly DB4S-version and Spatialite 5.0.1 on Win 8.1 64.
Copied all dll files from MinGW-DL in all 3 possible folders, tried 32, 64, 32 in 64. Nothing works.
3.12.2 also doesn't work.
After copying all files to all folder with all renames and 32+64bit it ended up with a error and missing entry point in libgeos-3-9-0.dll.
Maybe someone could zip all 100s of necessary dll files to put them all into DB4S-folder to solve this annoying incompatibilties of DB4S, Spatialite, SQLite, OS4Geo, MinGW, Windows and all the other programs you need to do the very first steps.
@sandman7920: Thanks!! freexl.dll from #2538 was missing, and libfreexl-1.dll too, at least for me.
After adding those 8 files to DB4S-folder and copying all mod_spatialite-files too, it seems to run with latest versions.
SELECT 'SQLite version:' AS Lib, sqlite_version() AS Version
UNION SELECT 'Spatialite:', spatialite_version()
UNION SELECT 'GEOS', geos_version()
UNION SELECT 'spatialite_target_cpu', spatialite_target_cpu()
UNION SELECT 'FreeXL', freexl_version()
UNION SELECT 'Proj', proj_version()
UNION SELECT 'Proj4', proj_version()
UNION SELECT 'RTTopo', rttopo_version()
UNION SELECT 'LibXML2', libxml2_version()
@ThoKau - Where did you get the 5.0.1 files from? I could only (albeit from the link above) see the older 4.3 version. I saw the source files for 5.0.1 - did you compile it yourself? If so, could I be sneaky and ask if you could 7zip the files and email them to me?
Optionally if don't have msvcrt2019 and OpenSSL installed system-wide you can get them from v2 repo
If you don't want to pollute the DB4S folder with external libraries (easy update for both DB4S and mod_spatialite),
create a new folder for example D:\mod_spatilite, copy all libraries there, and add the folder to the user or system path.
Then load mod_spatialite.dll from the newly created folder.
Activity
justinclift commentedon Apr 21, 2015
As a thought, which OS are you using, and which version of DB4S and the SpatiaLite extension? (not sure if it makes a difference, but it's helpful to know)
giumas commentedon Apr 21, 2015
I am on Win7 x64. For the DB4S (x86) version, I attach a screenshot with the about:

For the spatialite extension, I am using the last stable (4.2.0): http://www.gaia-gis.it/gaia-sins/windows-bin-x86/
I am not sure that I am properly using the application .. I was not able to find documentation on the "load extension". However, to reproduce my error, I open DB4S, then I create a dummy table and I try to "load extension" selecting the dll in a folder where I unzipped the 7z archive:
justinclift commentedon Apr 21, 2015
Hmmm yeah, I'm not sure either. @MKleusberg or @rp- may know more... 😄
green3g commentedon May 11, 2016
I'm having this problem also. I am trying to load the ST_Geomtry extension for ArcGIS:
http://desktop.arcgis.com/en/arcmap/latest/manage-data/databases/spatially-enable-sqlilte.htm
I've added all the PATH's and the command works via command line sqlite3, but not in the browser.
justinclift commentedon May 11, 2016
Hmmm, as a thought, is the extension a .dll file? If so, copying it into the same directory as the sqlitebrowser.exe file might let it be found.
No guarantees, but it's worth a shot. 😄
jimothyr commentedon Aug 9, 2016
I am having the same problem. I have tried the same directory approach , and no dice..
Win7 x64 db version 3.8.0
justinclift commentedon Aug 9, 2016
Thanks @jimothyr. It sounds like we should investigate this properly after the 3.9.0 release (which is due any day now).
zhm commentedon May 1, 2017
I ran into this same issue and I finally got it to work. It has to do with the library search paths on Windows because
mod_spatialitein turn loads its own dependent DLLs that reside in the same directory asmod_spatialite.dll.I got it working 2 different ways:
1.) Add the directory containing the spatialite
.dllfiles to your%PATH%. Windows searches%PATH%for dll files so it will be able to locate it.2.) Copy the
.dllfiles to the same directory containingDB Browser for SQLite.exe. e.g.C:\Program Files\DB Browser for SQLiteorC:\Program Files (x86)\DB Browser for SQLitewhichever version you have installed (32bit or 64bit). You will also want to make sure you use the correct x86 or x64 dll files that correspond to the version of sqlitebrowser you have.This works because Windows searches for .dll files in
%PATH%and the current application directory. So putting them in either place works.If
mod_spatialitewere shipped as fat binary containing everything in a single dll file I don't believe this would be necessary and it would just work pointing it at the dll, but until then we have to make sure all of the .dll's are located somewhere Windows will search when loading shared libs.justinclift commentedon May 1, 2017
@zhm That's pretty awesome. 😄
Any interest in cutting-n-pasting that into a wiki page, for better visibility of the info? It's seems like pretty arcane knowledge that others would definitely benefit from.
zhm commentedon May 1, 2017
I added a new page.
https://github.com/sqlitebrowser/sqlitebrowser/wiki/SpatiaLite-on-Windows
zhm commentedon May 1, 2017
I think this issue can be closed because it's definitely not an issue with DB4S. I don't believe there's anything to be done other than making a more location-independent build of
mod_spatialite.36 remaining items
barbalex commentedon Apr 8, 2021
@chrisjlocke Yeah, makes sense.
Sqflite uses whatever the platform (Android, iOS) provides (tekartik/sqflite#70 (comment)). I am not sure if it will be possible to load spatialite under these circumstances, even if dart:ffi seems to let me run c code. Will have to try, I guess.
stuartong commentedon May 13, 2021
@chrisjlocke I did the steps you described, saved and ran Select spatialite_version() but i got an error saying its not loaded and it won't 'persist' as an extension - disappears every time I close db browser
chrisjlocke commentedon May 13, 2021
You're loading it in the preferences section, as per this comment?
#267 (comment)
stuartong commentedon May 18, 2021
@chrisjlocke yes i followed those steps but was unable to load the extension
chrisjlocke commentedon May 18, 2021
Can you send a screenshot of the error you get? What operating system are you using? What DB4S version are you using?
ThoKau commentedon Aug 1, 2021
Doesn't work here, same error as mentions 100s of times before.
Testing with nighly DB4S-version and Spatialite 5.0.1 on Win 8.1 64.
Copied all dll files from MinGW-DL in all 3 possible folders, tried 32, 64, 32 in 64. Nothing works.
3.12.2 also doesn't work.
After copying all files to all folder with all renames and 32+64bit it ended up with a error and missing entry point in libgeos-3-9-0.dll.
Maybe someone could zip all 100s of necessary dll files to put them all into DB4S-folder to solve this annoying incompatibilties of DB4S, Spatialite, SQLite, OS4Geo, MinGW, Windows and all the other programs you need to do the very first steps.
justinclift commentedon Aug 1, 2021
Ok, it sounds like we'll need some assistance from a specialist that knows GIS stuff.
@sandman7920 Are you able to help out here, and get things working? 😄
sandman7920 commentedon Aug 2, 2021
@ThoKau if you are ok with spatialite-4.3.0a please look at #2538
You need to copy all dependencies into DB4S root folder or somewhere in the system path
dependencies:
Then mod_spatialite.dll should be loaded without problem.
chrisjlocke commentedon Aug 2, 2021
I'll fire up a Win 8.1 virtual machine and have a look.
chrisjlocke commentedon Aug 2, 2021
@ThoKau - Does it need to be Spatialite 5.0.1 - seems the osgeo4w files only go to 4.3.0a
ThoKau commentedon Aug 2, 2021
@sandman7920: Thanks!! freexl.dll from #2538 was missing, and libfreexl-1.dll too, at least for me.
After adding those 8 files to DB4S-folder and copying all mod_spatialite-files too, it seems to run with latest versions.
Lib versions shown in DB4S 3.12.99:
FreeXL 1.0.6
GEOS 3.9.0-CAPI-1.16.2
LibXML2 2.9.10
Proj Rel. 7.2.1, January 1st, 2021
Proj4 Rel. 7.2.1, January 1st, 2021
RTTopo 1.1.0
SQLite version: 3.36.0
Spatialite: 5.0.1
spatialite_target_cpu x86_64-w64-mingw32
SELECT 'SQLite version:' AS Lib, sqlite_version() AS Version
UNION SELECT 'Spatialite:', spatialite_version()
UNION SELECT 'GEOS', geos_version()
UNION SELECT 'spatialite_target_cpu', spatialite_target_cpu()
UNION SELECT 'FreeXL', freexl_version()
UNION SELECT 'Proj', proj_version()
UNION SELECT 'Proj4', proj_version()
UNION SELECT 'RTTopo', rttopo_version()
UNION SELECT 'LibXML2', libxml2_version()
chrisjlocke commentedon Aug 3, 2021
@ThoKau - Where did you get the 5.0.1 files from? I could only (albeit from the link above) see the older 4.3 version. I saw the source files for 5.0.1 - did you compile it yourself? If so, could I be sneaky and ask if you could 7zip the files and email them to me?
ThoKau commentedon Aug 3, 2021
Oh, I'm too lazy to compile myself... :-)
http://www.gaia-gis.it/gaia-sins/ or http://www.gaia-gis.it/gaia-sins/windows-bin-amd64/
sandman7920 commentedon Aug 5, 2021
@ThoKau now you have a mixture between MinGW/MSVC C/C++ runtime and sqlite3.dll/libsqlite3-0.dll DB4S/gaia-sins
osgeo4w provides v2 repo which contains version 5.0.1 of the mod_spatialite.
sandman7920 commentedon Aug 5, 2021
OSGeo4W mod_spatialite-5.0.1 dependencies:
Optionally if don't have msvcrt2019 and OpenSSL installed system-wide you can get them from v2 repo
If you don't want to pollute the DB4S folder with external libraries (easy update for both DB4S and mod_spatialite),
create a new folder for example
D:\mod_spatilite, copy all libraries there, and add the folder to the user or system path.Then load mod_spatialite.dll from the newly created folder.