Hi Group,
the last couple of weeks, I've been testing SQLite. I indent to make it part of an application of mine.
I've noticed that Kapital (http://www.kapital-billing.com/), a very nice billing application written by forum member Karbon uses SQLite, but apparently doesn't contain the sqlite.dll in the distribution. This leads me to the assuption, that SQLite can somehow be statically linked.
I searched this forum and read the SQLite docuementation, but couldn't find out how to statically link in SQLite.
I'd very much like to learn about how to do it!
Thanks!
Statically linking SQLite possible?
-
dell_jockey
- Enthusiast

- Posts: 767
- Joined: Sat Jan 24, 2004 6:56 pm
-
Edwin Knoppert
- Addict

- Posts: 1073
- Joined: Fri Apr 25, 2003 11:13 pm
- Location: Netherlands
- Contact:
-
dell_jockey
- Enthusiast

- Posts: 767
- Joined: Sat Jan 24, 2004 6:56 pm
bedankt Edwin!
your link made me re-think my options: it is possible to link in the DLL as a binary resource, and have the application copy this binary resource into a memory mapped file after start-up. The next step would be to have that application use memory mapped DLL's it copied there itself.
Would that be possible somehow?
your link made me re-think my options: it is possible to link in the DLL as a binary resource, and have the application copy this binary resource into a memory mapped file after start-up. The next step would be to have that application use memory mapped DLL's it copied there itself.
Would that be possible somehow?
-
Edwin Knoppert
- Addict

- Posts: 1073
- Joined: Fri Apr 25, 2003 11:13 pm
- Location: Netherlands
- Contact:
dell_jockey,
If it's OK to extract the sqlite.dll file from your executable and write it to a disk file, you can do this:
It isn't quite as convenient as static linking, but it works!
Regards,
Eric
If it's OK to extract the sqlite.dll file from your executable and write it to a disk file, you can do this:
Code: Select all
;- make sure SQLite DLL is present and initialized
Procedure.l SQLiteInit()
; check if SQLite DLL is present
If FileSize("sqlite.dll") = -1
; not present - extract DLL and write to disk
If OpenFile(1, "sqlite.dll")
WriteData(?SQLite, ?SQLiteEnd-?SQLite)
CloseFile(1)
Else
MessageRequester("SQLite Error", "Can't write DLL file", #MB_ICONERROR | #MB_OK)
ProcedureReturn #False
EndIf
EndIf
; load/init SQLite DLL
ProcedureReturn InitSQLite("sqlite.dll")
EndProcedure
*
*
*
SQLite:
IncludeBinary "sqlite.dll"
SQLiteEnd:Regards,
Eric
Well, thanks for the kind words 
My software bundles the SQLite DLL with the EXE using some 3rd party software - it's not really statically linked after all!
My software bundles the SQLite DLL with the EXE using some 3rd party software - it's not really statically linked after all!
-Mitchell
Check out kBilling for all your billing software needs!
http://www.k-billing.com
Code Signing / Authenticode Certificates (Get rid of those Unknown Publisher warnings!)
http://codesigning.ksoftware.net
Check out kBilling for all your billing software needs!
http://www.k-billing.com
Code Signing / Authenticode Certificates (Get rid of those Unknown Publisher warnings!)
http://codesigning.ksoftware.net
-
dell_jockey
- Enthusiast

- Posts: 767
- Joined: Sat Jan 24, 2004 6:56 pm
