Reid Thompson wrote:
> a SQLite devpak for dev-cpp --- template program compiles out of the
> box
>
> http://www.ingmezzina.it/dev-packs/default.asp
>

Unfortunately it uses version 2.8.8 of SQLite which is very old.

I have used Bloodshed's DevC++ IDE to build apps linked to the libsqlite
library produced by a MinGW/MSYS build of SQLite from CVS source. It works
as expected.

You need to include "sqlite.h" in your source and add the library
libsqlite.a (which is stored in the .libs subdirectory by the SQLite
Makefile) to the Project Options-Parameters Tab-Linker List so that it gets
linked to your application. I write my main routines using C++ so I can use
the stream based I/O and all the other features of C++, so this isn't your
problem either.

I haven't tried linking to a DLL using DevC++, but that should be basically
the same, except you will need to produce a gcc compatible import library
for the DLL and link to that rather than libsqlite.a. You can do this with
dlltool like so;

dlltool --implib libsqlitedll.a --dllname sqlite.dll --input-def
./sqlite/sqlite.def

Then add libsqlitedll.a to the project instead of libsqlite.a. Make sure you
copy sqlite.dll into the same directry as your application (or the
windows/system directory).

Also remember to set the Project Option-Compiler Tab-Linker options-Generate
debugging information to Yes if you want to use the DevC++ built in
debugger.

I haven't tried to build SQLite using DevC++, but I don't think there would
be any difficulty starting from the prepared source for Windows. Building
frrom CVS would require adding commands to build the parser generator,
lemon.exe, and files like opcodes.h. It's simply easier to use MinGW/MSYS to
build since it is supported by the distirbuted SQLite Makefile.

I hope this helps.

Reply via email to