Reputation: 2500
I installed sqlite3 from ports on FreeBSD and now does not sure how to correctly use it. So, I have some simple sqlite program from official tutorial. When compiling #include <sqlite3.h>
with such command gcc test.c
got the error: "sqlite.h" No such file
So, what is the best way to compile and use installed from ports sqlite
library? Need I to copy sqlite.h to every program directory? Or how to use already installed .h
on system? Seems need also link library to the program, how to do this? thanks
Upvotes: 0
Views: 415
Reputation: 12407
You need to tell gcc where to look for includes, and you need to tell it to link against sqlite's library, which is probably called libsqlite.so
You're looking for something along the lines of gcc -I /usr/local/include -lsqlite test.c
.
Upvotes: 1