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

using sqlite.dll on windows with a twapi tclkit

113 views
Skip to first unread message

two...@gmail.com

unread,
Jun 9, 2018, 8:15:54 PM6/9/18
to
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

unread,
Jun 10, 2018, 10:03:10 AM6/10/18
to
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

unread,
Jun 10, 2018, 10:58:31 AM6/10/18
to
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

unread,
Jun 10, 2018, 1:52:38 PM6/10/18
to
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

unread,
Jun 10, 2018, 2:16:31 PM6/10/18
to
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

unread,
Jun 10, 2018, 3:38:37 PM6/10/18
to
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

unread,
Jun 10, 2018, 10:25:09 PM6/10/18
to
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

unread,
Jun 11, 2018, 3:53:37 AM6/11/18
to
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

unread,
Jun 11, 2018, 6:26:15 AM6/11/18
to
You don't really need the package require. That was just to print the
version.
0 new messages