Error: undefined reference to `sqlite3_open'

前端 未结 4 2008
孤独总比滥情好
孤独总比滥情好 2020-12-13 18:28

I\'m trying to get started with the C++ API for SQLite.

#include 
#include 

using namespace std;

int main()
{
    sqlite3         


        
4条回答
  •  一向
    一向 (楼主)
    2020-12-13 18:50

    First step: Install all library sqlite3 with the command:

            sudo apt-get install libsqlite3-dev
    

    With that you can use #include in a programm of C or C++.

    Second step: To compile the program by console:

    C++:

            g++ program.cpp -o executable -lsqlite3
    
            ./executable
    

    C:

            gcc program.c -o executable -lsqlite3
    
            ./executable
    

提交回复
热议问题