• Sqlite extension loading

    From Torsten Berg@21:1/5 to All on Sun Oct 2 01:18:33 2022
    Hi,

    not sure, this is probably not really a Tcl issue, but maybe someone has a clue here:

    When I try to load an Sqlite extension, it seems as if the path to the extension library get's mangled.

    This is on a Mac running macOS Catalina and Tcl 8.6.11. Let's start on a Wish console:

    1 % package require sqlite3
    3.25.3
    () 2 % sqlite3 db /Users/Torsten/somefile.gpkg
    () 3 % db enable_load_extension true

    Until here, everything works as expected. I have opened the Geopackage file (which is just a special Sqlite file). Then I want to enable the spatialite extension:

    () 4 % db eval {SELECT load_extension('/pathTo/libspatialite-5.0.1/mod_spatialite')}
    dlopen(libsqlite3/pathTo/libspatialite-5.0.1/mod_spatialite.dylib, 6): image not found

    The message I get suggests that the path to the extension library now has an element 'libsqlite3' prepended ... and of course this path does not exist.

    Has anyone seen this before and has a hint on what I might be doing wrongly?

    Thanks!

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Torsten Berg@21:1/5 to Torsten Berg on Wed Oct 5 14:00:39 2022
    For the record: it is solved. I just had to compile a recent version of the sqlite3 package for Tcl (took the current version 3.39.4) and then everything worked as expected.

    File closed.

    On Sunday, October 2, 2022 at 10:18:35 AM UTC+2, Torsten Berg wrote:
    Hi,

    not sure, this is probably not really a Tcl issue, but maybe someone has a clue here:

    When I try to load an Sqlite extension, it seems as if the path to the extension library get's mangled.

    This is on a Mac running macOS Catalina and Tcl 8.6.11. Let's start on a Wish console:

    1 % package require sqlite3
    3.25.3
    () 2 % sqlite3 db /Users/Torsten/somefile.gpkg
    () 3 % db enable_load_extension true

    Until here, everything works as expected. I have opened the Geopackage file (which is just a special Sqlite file). Then I want to enable the spatialite extension:

    () 4 % db eval {SELECT load_extension('/pathTo/libspatialite-5.0.1/mod_spatialite')}
    dlopen(libsqlite3/pathTo/libspatialite-5.0.1/mod_spatialite.dylib, 6): image not found

    The message I get suggests that the path to the extension library now has an element 'libsqlite3' prepended ... and of course this path does not exist.

    Has anyone seen this before and has a hint on what I might be doing wrongly?

    Thanks!

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)