Google 網路論壇不再支援新的 Usenet 貼文或訂閱項目,但過往內容仍可供查看。

Include sqlite in Windows starpack

瀏覽次數:101 次
跳到第一則未讀訊息

Stephen Nally

未讀,
2018年3月19日 下午4:12:292018/3/19
收件者:
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

未讀,
2018年3月19日 下午6:52:562018/3/19
收件者:
You could install tcl from magicsplat.com and copy the lib/sqlite folder
into the vfs/lib folder.

pd

Ashok

未讀,
2018年3月20日 清晨6:37:192018/3/20
收件者:
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

未讀,
2018年3月20日 晚上11:44:312018/3/20
收件者:
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

未讀,
2018年3月21日 清晨7:00:142018/3/21
收件者:
I suppose that you have a 32/64 bit issue. This is crucial for DLL load.

Just a guess,
Harald

Stephen Nally

未讀,
2018年3月21日 下午2:33:042018/3/21
收件者:
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

未讀,
2018年3月21日 下午4:14:482018/3/21
收件者:
No. I've done this before with various tcls. Just doesn't work with
macicsplat.

Peter Dean

未讀,
2018年3月27日 晚上9:32:032018/3/27
收件者:
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 則新訊息