Tcl Starkit, which reads from the Sqlite database

I am trying to create a Tcl application that reads a Sqlite database. When I create starkit for the application and place the Sqlite database file next to the .tcl file in the .vfs folder and try to run the application (.exe), I get the error message: "cannot find sqlite3 package at run time package requires sqlite3."

I believe that my application cannot find the database file. Before creating starkit, the .tcl application may read the Sqlite database, but after creating starkit, the .tcl file receives an error.

Does anyone know how to enable stclit Tcl application to read Sqlite database file?

Thanks,

DFM

+3
source share
3

, , starkit sqlite3. lib .vfs sqlite3?

+5

, .

- sqllite3. , sqllite3 (tcl ) lib starpack. , " sqlite3" .

-writable. , Starpack . , Starpack, , (, , ).

, ( a) starkit, - . , Brent Welch " Tcl Tk":

write.kit , , write.kit/data.new . , Metakit Starkit. , -writable sdx:

sdx wrap write.kit writable

Referece: Google Books

+4

, - , , Tcl Back-end Sqlite. :

  • tclkit-win32.upx.exe sdx.kit.

  • tclkit-win32.upx.exe tclkit.exe ( )

  • .tcl(test.tcl) (, package require sqlite.

  • tclkit-win32.upx.exe ( ):

    source sdx.kit
    package require sdx
    sdx::sdx qwrap test.tcl
    sdx::sdx unwrap test.kit
    
  • tclsqlite3.dll sqlite . sqlite.

  • , , :

    package ifneeded sqlite 3.6.18 [list load [file join $dir tclsqlite3.dll]].
    

    pkgIndex.tcl sqlite tclsqlite3.dll.

  • . .vfs. .vfs lib. sqlite lib. lib - ( test.tcl) sqlite.

    5-7: , dll sqlite tcl C:\ lib. dll

      package ifneeded sqlite3 [package require sqlite3]
    

    sqlite , dll pkgIndex.tcl. , package require sqlite3 3.

  • When tclkit-win32.upx.exestill running, enter the following code:

    sdx::sdx wrap test.exe -runtime tclkit.exe
    
  • Finally, put your sqlite.db file next to your newly created .exe application (test.exe) and run the application.

Watch out for version conflicts. I had serious problems with a piece of code package require sqlite. I originally had package require sqlite3one that didn't work. Also, when you create the file pkgIndex.tcl, make sure that you have the correct sqlite version (i.e. 3.2.18, etc.).

Thank you for your help.

DFM

+2
source

Source: https://habr.com/ru/post/1717887/


All Articles