You could build the SQLite Amalgamation as a library and link against it... But if you're writing a native C++ application it's much easier to just compile SQLite directly into your project.
First, follow the project wizard settings and create a "Windows Application" and choose "Emply Project". Choose No ATL, no MFC and no Precompiled-Headers.
Once you have the empty/skeleton project building successfully, add sqlite3.c
and sqlite3.h
from the SQLite Amalagamation to the project.
In the .CPP file that contains wmain()
add #include "sqlite3.h"
Finally, in your wmain()
function, somewhere after the initialization code but before the main message loop add the following:
sqlite3 *db;
sqlite3_open(":memory:", &db);
This is the bare-minimum necessary code to create an empty in-memory SQLite database.
If the above project compiles and links - you should be good to go!