FS#46322 - [libspatialite] cannot be loaded as a sqlite extension

Attached to Project: Community Packages
Opened by beojan (beojan) - Thursday, 17 September 2015, 11:15 GMT
Last edited by Jaroslav Lichtblau (Dragonlord) - Monday, 01 October 2018, 11:53 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Jaroslav Lichtblau (Dragonlord)
Architecture All
Severity High
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
libspatialite cannot be loaded as a sqlite extension and fails with the error

undefined symbol: sqlite3_spatialite_init

Additional info:
* package version(s): 4.3.0-1
* config and/or log files etc.


Steps to reproduce:

Attempt to load libspatialite as a sqlite extension.
This task depends upon

Closed by  Jaroslav Lichtblau (Dragonlord)
Monday, 01 October 2018, 11:53 GMT
Reason for closing:  Not a bug
Comment by Egorov Sergej (Cetronix) - Tuesday, 08 November 2016, 23:23 GMT
  • Field changed: Percent Complete (100% → 0%)
the new version has the same error

SQLite version 3.15.1 2016-11-04 12:08:49
Enter ".help" for usage hints.
sqlite> .load libspatialite.so
Error: /usr/lib/libspatialite.so: undefined symbol: sqlite3_spatialite_init
sqlite>

package: libspatialite
package version(s): 4.3.0.a-2
arch: x86_64
buid date: 15 sept 2016
Comment by Alex (nylocx) - Friday, 03 March 2017, 10:02 GMT
This is intended behaivor from the offical docs:


libspatialite (.so, .dll, .dylib and so on): a genuine classic shared library.
It will always depend on some external libsqlite3, and is uniquely intended to be used by stand-alone applications (such as e.g. spatialite or spatialite_gui).
You'll never be able to successfully load this libspatialite shared library as a dynamic extension via the SELECT load_extension mechanism, simply because it doesn't declare the required conventional interface.

mod_spatialite (.so, .dll, .dylib and so on): this is simply intended as pure loadable module lacking any explicit SQLite3 dependency.
You'll never be able to directly link this mod_spatialite shared library following the classic way, because it doesn't declare any external link symbol except that a single one: i.e. the conventional interface. The unique possible way to load and activate this module is by calling a SELECT load_extension SQL statement.

Loading...