I assume that you already created C++ Win32 project where you want to include SQLite.
- Navigate to https://www.sqlite.org/download.html and download latest
amalgamation
source version of SQLite. - Extract all the files into your project directory, or your include path, or separate path that you will add/added as include path in your project properties.
- Run
Developer Command Prompt for VS ****
which is usually available atStart -> Programs -> Visual Studio **** -> Visual Studio Tools
. - Navigate with command prompt to that directory where we extracted our SQLite.
- Run next command to compile:
cl /c /EHsc sqlite3.c
- Run next command to create static library:
lib sqlite3.obj
- Open properties of your project and add
sqlite3.lib
toLinker -> Input -> Additional Dependencies
.
Now you ready to include and use sqlite3.h
in your project.
Yes. If I run lib /list sqlite3.lib on it, it shows sqlite3.dll multiple times, which do not seem like proper objects to me. I am using Visual Studio 2017 cl v19). For now, it was pretty easy and the solution seemed to be just to compile it directly into the target application, since you just need the headers and the sqlite3.c file to do so and cl happily accepts mixed code (C and C++) in a single target. This being said, I would still like more to have it as a standalone static library...