Documentation on SQLite can be had at the project's home page. There is a quick start guide as well.
However, before that information is useful, you need to understand how to use your compiler and linker to build a program that uses external libraries. From the question you are asking, some of this isn't yet clear, so perhaps a review is in order:
The compiler (which is the MinGW release of GCC from the Dev-Cpp IDE distribution) converts source text conventionally found in .c and .h files into object files which contain machine language with values for some symbols left unspecified. The linker (Gnu's ld is used with MinGW) takes object files from its command line as well as from libraries (generally .a files, where the option -lsqlite3
would refer to the library file named libsqlite3.a
) and collects them in to a single executable.
So, in order to use the SQLite library, you need its header files in a place where the compiler can located them to satisfy a #include
directive. And you need the matching object library so the linker can satisfy all references to functions in the SQLite API.
One recommended way to include SQLite in a project is to compile it from the single-file amalgamation, and link it directly to your program. By doing it this way, you get a library that was compiled with the same compiler as the rest of your application (which reduces the chance of subtle problems at run time) and don't need to have a DLL (or .so) file in your distribution to cause issues for your users.
It is also recommended that you have a copy of the sqlite3.exe utility available. This is a useful utility that lets you inspect a SQLite database file and make ad-hoc changes. Just put it somewhere in your PATH so that it can be used from a command prompt.
If you must use a pre-build DLL, then one is available from the SQLite project. It happens to be compiled in a way that is compatible with MinGW. Specifically, it uses the same C runtime library used by MinGW. Note that it might not be completely compatible if you were using Visual Studio or another compiler for Windows.