I want to build this process on an embedded Linux without installing sqlite3 or sqlite3-dev (I already tried to install them and it worked out).
I've 4 files in the directory : main.cpp sqlite3.c sqlite3.h example.db
I included the sqlite3.h in the main.cpp this way:
extern "C"{
#include "sqlite3.h"
}
Then I typed those commands :
gcc -c sqlite3.c -o sqlite3.o
g++ -c main.cpp -o main.o
and it was already so far, then I wrote this
g++ -o main.out main.o -L.
but I'm getting those errors
main.o: In function `main':
main.cpp:(.text+0xf6): undefined reference to `sqlite3_open'
main.cpp:(.text+0x16d): undefined reference to `sqlite3_exec'
main.cpp:(.text+0x1c6): undefined reference to `sqlite3_exec'
main.cpp:(.text+0x1f7): undefined reference to `sqlite3_free'
main.cpp:(.text+0x25c): undefined reference to `sqlite3_exec'
main.cpp:(.text+0x299): undefined reference to `sqlite3_exec'
main.cpp:(.text+0x2ca): undefined reference to `sqlite3_free'
main.cpp:(.text+0x32f): undefined reference to `sqlite3_exec'
main.cpp:(.text+0x33b): undefined reference to `sqlite3_close'
collect2: error: ld returned 1 exit status
How to statically link those files?