I am trying to build a Tcl Application that reads off of a Sqlite database. When I build a starkit for the application and place the Sqlite database file next to the .tcl file within the .vfs folder and try to run the application (.exe), I receive the error, "can't find package sqlite3 while executing package require sqlite3".
I believe my application is unable to find the database file. Before building the starkit, the .tcl application is able to read the Sqlite database, but after I create the starkit, the .tcl file gets the error.
Does anyone know how to enable a Tcl application starkit to read a Sqlite database file?
Thanks,
DFM
With the help of everyone who replied to my question and some thorough research, I figured out steps to create a starpack that wraps a Tcl App with a Sqlite back-end. The steps to create the starpack are as follows:
Download and place in a folder
tclkit-win32.upx.exe
andsdx.kit
.Make a copy of the
tclkit-win32.upx.exe
and rename it totclkit.exe
(leave in same folder)Add your .tcl (
test.tcl
) application to the folder (make sure that it has the codepackage require sqlite
.Run the
tclkit-win32.upx.exe
file and type the following per line (do not close when done):Download
tclsqlite3.dll
from the sqlite website and place in a separate folder. Name the foldersqlite
.Use a text app like Notepad and add the following code:
Save as
pkgIndex.tcl
and place in the sqlite folder with thetclsqlite3.dll
.Go into your first folder in step one. You should see a .vfs folder. Open the .vfs folder, and then open the lib folder. Place the sqlite folder in the lib folder. The lib folder should have a app-test folder (corresponds with
test.tcl
) and your sqlite folder.With
tclkit-win32.upx.exe
still running, type the following code:Lastly, place your sqlite .db file next to your newly created application .exe (test.exe) and run the app.
Make sure to watch for version conflicts. I had major problems with the
package require sqlite
code snippet. Originally, I hadpackage require sqlite3
, which wasn't working. Also, when you create thepkgIndex.tcl
file, make sure to have the correct version of sqlite (i.e. 3.2.18, etc...).Thank you for everyone's assistance.
DFM