Skip to content

Instantly share code, notes, and snippets.

@menjaraz
Forked from payalord/sqlite_static_cpp.md
Created November 21, 2023 06:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save menjaraz/772490a0233eb5c03b3c9c128f18c09d to your computer and use it in GitHub Desktop.
Save menjaraz/772490a0233eb5c03b3c9c128f18c09d to your computer and use it in GitHub Desktop.
How to add SQLite into your VS project as Static Library

I assume that you already created C++ Win32 project where you want to include SQLite.

  1. Navigate to https://www.sqlite.org/download.html and download latest amalgamation source version of SQLite.
  2. 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.
  3. Run Developer Command Prompt for VS **** which is usually available at Start -> Programs -> Visual Studio **** -> Visual Studio Tools.
  4. Navigate with command prompt to that directory where we extracted our SQLite.
  5. Run next command to compile: cl /c /EHsc sqlite3.c
  6. Run next command to create static library: lib sqlite3.obj
  7. Open properties of your project and add sqlite3.lib to Linker -> Input -> Additional Dependencies.

Now you ready to include and use sqlite3.h in your project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment