Page 1 of 1
SQLite as PB lib ? Single Executable.
Posted: Wed Jun 30, 2004 7:46 pm
by USCode
Using a tool like this that Fr34k has put together:
http://freak.purearea.net/tools/
And since the source code to SQLite is readily available...

Wouldn't it be possible to compile SQLite into a .lib or .obj file using a C compiler, then combine that with El Choni's SQLite library, run Fr34ks tool and "viola" - create a PB library that could be linked by PB with your PB application all into a single executable? Just like any other PB library?
Rather than importing/exporting the SQLite DLL, etc. as has been discussed here in the past.
Just a thought.
( Caveat: I am PB library ignorant, so I apologize in advance if this question doesn't make any sense. )
Posted: Wed Jun 30, 2004 8:49 pm
by Karbon
ElChoni has a SQLite userlib already that does that. It might be possible to statically link the SQLite library into a PB executable, though I don't know how.
Posted: Wed Jun 30, 2004 9:54 pm
by USCode
ElChoni has a SQLite userlib already that does that
Hi Karbon,
Yeah, I'm aware of El Choni's library but what I was driving at was combining El Choni's SQLite interface library and statically linking SQLite into the executable. Some folks have brought SQLite into the data section and writing it out at runtime, etc. but I was looking for a method to formally link it in as part of the executable.
Thanks
Posted: Thu Jul 01, 2004 3:00 am
by El_Choni
Since the SQLite dll C source is available, you could implement it as a Purelibrary, entirely.
You only need some spare time XD
EDIT: I don't know if the SQLite license allows this.
Posted: Thu Jul 01, 2004 5:24 pm
by pbSync
USCode wrote:ElChoni has a SQLite userlib already that does that
Hi Karbon,
Yeah, I'm aware of El Choni's library but what I was driving at was combining El Choni's SQLite interface library and statically linking SQLite into the executable. Some folks have brought SQLite into the data section and writing it out at runtime, etc. but I was looking for a method to formally link it in as part of the executable.
Thanks
Quick solution to bundle a dll with your exe could be this tool:
http://www.collakesoftware.com/pebundle.htm
don't know, whether this works or is allowed.
Posted: Thu Jul 01, 2004 9:10 pm
by USCode
Thanks pbSync and I've seen that discussed is other threads but I wanted SQLite to be a first-class PB library.
Posted: Thu Jul 01, 2004 10:28 pm
by thefool
But as PE bundle cost some $ you can do this entirely free in PB.
Its very simple to do it, just requires 5 line of simple code.
Posted: Fri Jul 02, 2004 6:03 am
by HAnil
thefool wrote:
Its very simple to do it, just requires 5 line of simple code.
would you like to share this 5 line code.
Posted: Fri Jul 02, 2004 8:41 am
by thefool
Sorry. It was 8 lines of code
but here it is, with comments. Just remove those, though..
Code: Select all
;This creates the file.
;Replace "test.txt" with anything else.
CreateFile(1,"test.txt")
WriteData(?startfile,?endfile-?startfile)
CloseFile(1)
;This has to be putted after the createfile()
;I always put it in the bottom of the file.
;Rename "test.txt" to any file you want.
;Remember you need to have the file in the dir
;with the sourcecode.
DataSection
startfile:
IncludeBinary "test.txt"
endfile:
EndDataSection
But if you have to use this for a DLL, you need to do the createfile()
before calling it. But this also works for exe and any other file.
Posted: Fri Jul 02, 2004 5:44 pm
by pbSync
thefool wrote:But as PE bundle cost some $ you can do this entirely free in PB.
Its very simple to do it, just requires 5 line of simple code.
Writing to disk is easy in pb. But PE Bundle extracts the DLL direct to memory, which feels more like a lib and is not so easy to do in pb (at least I don't know how to do it). So it has its uses.