Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Include sqlite in Windows starpack

101 views
Skip to first unread message

Stephen Nally

unread,
Mar 19, 2018, 4:12:29 PM3/19/18
to
Hello Tcl'ers

I am struggling to get Sqlite working in a Windows Starpack.

I go through a procedure similar to

http://wiki.tcl.tk/8900

The Starpack is created, but when I run it, I get 'can't find package sqlite3 while executing "package require sqlite3"'


Normally to include a package I just copy the package from tclib to the unwrapped vfs.

The problem is that I can't find a sqlite package anywhere.

I can build starpacks with other packages with no problems.

Thanks,

Stephen Nally

Peter Dean

unread,
Mar 19, 2018, 6:52:56 PM3/19/18
to
You could install tcl from magicsplat.com and copy the lib/sqlite folder
into the vfs/lib folder.

pd

Ashok

unread,
Mar 20, 2018, 6:37:19 AM3/20/18
to
On 3/20/2018 4:22 AM, Peter Dean wrote:
>
> You could install tcl from magicsplat.com and copy the lib/sqlite folder
> into the vfs/lib folder.
>
> pd
>

Unfortunately, might be a bit more complicated than that. The magicsplat
distribution is compiled using VS 2017 and the compiled binaries depend
on the VS 2017 C runtime. The magicsplat installer will install this
runtime if not present on the target system but if you copy individual
binaries to some other system, that system may not have the C runtime
installed and the package binary will fail to load. My guess is most
(all?) Windows 10 systems will have these already but older Windows
versions may not.

I would suggest trying the sqlite binaries from BAWT instead as I
believe they are built using mingw which uses the old crt shipping since
Windows XP.

/Ashok

Peter Dean

unread,
Mar 20, 2018, 11:44:31 PM3/20/18
to
I installed BawtTcl to check it out. That solved a problem I recently
encountered which I'd put in the too hard drawer. I was unable to load
the spatialite extension in magicsplat tcl. The message was something
about not able to load a module. Could that be related?

Here's what I do to load spatialite. Download from
http://www.gaia-gis.it/gaia-sins/windows-bin-amd64/mod_spatialite-4.3.0a-win-amd64.7z
unzip into a folder on the path, I just put it with tclsh.exe

in tclsh

package require sqlite3
sqlite3 db :memory:
db enable_load_extension true
db eval {SELECT load_extension('mod_spatialite')}

that's where it fails.

pd




Harald Oehlmann

unread,
Mar 21, 2018, 7:00:14 AM3/21/18
to
I suppose that you have a 32/64 bit issue. This is crucial for DLL load.

Just a guess,
Harald

Stephen Nally

unread,
Mar 21, 2018, 2:33:04 PM3/21/18
to
Ashok's solution worked.

Thanks to everyone who replied.

For anyone else who needs it:

1. Downloaded SetupTcl-8.6.8-x86.exe from http://www.bawt.tcl3d.org/download.html
2. Ran SetupTcl-8.6.8-x86.exe
3. Copied the folder C:/Tcl/lib/Sqlite3.21.0 into the lib folder in the unwrapped vfs
4. Built the starpack.

Peter Dean

unread,
Mar 21, 2018, 4:14:48 PM3/21/18
to
No. I've done this before with various tcls. Just doesn't work with
macicsplat.

Peter Dean

unread,
Mar 27, 2018, 9:32:03 PM3/27/18
to
On 21-Mar-18 1:44 PM, Peter Dean wrote:
> package require sqlite3
> sqlite3 db :memory:
> db enable_load_extension true
> db eval {SELECT load_extension('mod_spatialite')}
>
> that's where it fails.
>
> pd
>
>
>
>
It also crashed in BAWT with this
db eval {SELECT InitSpatialMetaData()}

I finished up recompiling everything according to instructions here
http://www.gaia-gis.it/gaia-sins/mingw64_how_to.html

It still crashed with the included sqlite 3.21
I then compiled a new sqlite 3.22
It's all now working in Bawt and Magicsplat. Appears to be a problem
with sqlite 3.21

pd
0 new messages