Compiling SQLite3 with C++
If you want to write a C++ program that utilizes Sqlite3 you will need to take an extra step in the compile and link process in order to compile Sqlite3 with the C compiler (gcc), and then your C++ program with the C++ compiler (g++) If you try to compile Sqlite3 with g++ it will error.
For this example, I am using g++
and gcc
to compile. I tested this in Windows 10 with MinGW64, but it should also work in Linux and Mac.
If you want to learn more about using SQLite3, check out my other tutorials:
- All SQLite tutorials of mine at https://www.devdungeon.com/tags/sqlite
- SQLite3 Tutorial or
- Ruby SQLite Tutorial
- Ruby ActiveRecord (without Rails) Tutorial
- PHP SQLite Tutorial