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

using sqlite.dll on windows with a twapi tclkit

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

two...@gmail.com

未讀,
2018年6月9日 晚上8:15:542018/6/9
收件者:
I only use tcl/tk from tclkits. Lately, I've been using a tclkit (or starkit?) created with twapi built in. So, I don't really know how to set it up to use the package command.

I found a sqlite .dll (32bit) for windows. When I do a load command,

>cd ....path to where the .dll is....

>load sqlite3.dll sqlite3
cannot find symbol "Sqlite3_Init"

Any idea how to get this to work? The zip file I downloaded also had a file sqlite3.def, but I don't know what to do with that.

Harald Oehlmann

未讀,
2018年6月10日 上午10:03:102018/6/10
收件者:
You may need two packages: slqlite3 and tclsqllite.
Sometimes, they are bundled.
The error you are getting is due to the fact that it is not the tcl
sqlite package.

It works in starkits without problems.

Hope this helps,
Harald

Rich

未讀,
2018年6月10日 上午10:58:312018/6/10
收件者:
two...@gmail.com wrote:
> I only use tcl/tk from tclkits. Lately, I've been using a tclkit (or
> starkit?) created with twapi built in.

What version of Tcl does it contain.

> So, I don't really know how to set it up to use the package command.
>
> I found a sqlite .dll (32bit) for windows. When I do a load command,
>
>>cd ....path to where the .dll is....
>
>>load sqlite3.dll sqlite3
> cannot find symbol "Sqlite3_Init"
>
> Any idea how to get this to work? The zip file I downloaded also had
> a file sqlite3.def, but I don't know what to do with that.

No, not for this specific dll file.

But, if your Tclkit is Tcl 8.6+, unless the builder went out of their
way it should have sqlite built in.

Try "package require sqlite3" at a Tcl REPL prompt from the tclkit (if
it is 8.6+).

If your kit is less than version 8.6, then I'd suggest upgrading to a
kit that is version 8.6 and see if sqlite is already there.

two...@gmail.com

未讀,
2018年6月10日 下午1:52:382018/6/10
收件者:
On Sunday, June 10, 2018 at 7:58:31 AM UTC-7, Rich wrote:

>
> What version of Tcl does it contain.
>

It says 8.6.8. I found it on sourceforge,


https://sourceforge.net/projects/twapi/files/Tcl%20binaries/Tclkits%20with%20TWAPI/

tclkit-gui-8_6_8-twapi-4_2_13-x86-max.exe

Rich

未讀,
2018年6月10日 下午2:16:312018/6/10
收件者:
Then start a copy, and in the console window that appears type:

package require sqlite3

If you get version numbers back:

% package require sqlite3
3.8.0
%

Then your tclkit already contains sqlite.

two...@gmail.com

未讀,
2018年6月10日 下午3:38:372018/6/10
收件者:
On Sunday, June 10, 2018 at 11:16:31 AM UTC-7, Rich wrote:
>
> Then start a copy, and in the console window that appears type:
>
> package require sqlite3
>
> If you get version numbers back:
>
> % package require sqlite3
> 3.8.0
> %
>
> Then your tclkit already contains sqlite.

Unfortunately, it's not there.

I got the idea for the "load" from the wiki page on setting up sqlite, which would be great if it worked.

Ashok

未讀,
2018年6月10日 晚上10:25:092018/6/10
收件者:
The twapi tclkits do not include sqlite, you have to load it from an
external package. Trying it with the 64-bit version as I don't have the
32-bit one handy)

(sqlite3.21.0) 2 % load sqlite3210t.dll sqlite3
(sqlite3.21.0) 3 % package require sqlite3
3.21.0
(sqlite3.21.0) 4 % info name
C:/Users/ashok/Downloads/tclkit-gui-8_6_8-twapi-4_2_13-x64-max.exe

So it should work fine. My guess is that as Harald suggested, you are
using a sqlite dll that does not have Tcl bindings. You did not say
where you got the sqlite DLL from.

/Ashok

two...@gmail.com

未讀,
2018年6月11日 凌晨3:53:372018/6/11
收件者:
On Sunday, June 10, 2018 at 7:25:09 PM UTC-7, Ashok wrote:

> You did not say
> where you got the sqlite DLL from.
>
Got it. I had gotten mine from sqlite.org, so I guessed what I needed was to install the activestate somewhere and grab the dll from there. That worked as you showed.

I wouldn't have known to do the package require after the load, so many thanks.





Ashok

未讀,
2018年6月11日 清晨6:26:152018/6/11
收件者:
You don't really need the package require. That was just to print the
version.
0 則新訊息