tom
tom

Reputation: 11

include sqlite3 lib in c makfile

my makefile can't find my sqlite3 library, I want to link it with a -lsqlite3 flag in the gcc commandline. Can someone tell me want I am doing wrong here. The error message is the following:

/usr/bin/ld: cannot find -lsqlite3

tom

Upvotes: 0

Views: 2677

Answers (2)

Ignacio Vazquez-Abrams
Ignacio Vazquez-Abrams

Reputation: 798666

You forgot to pass -L followed by the directory containing the SQLite library. You can also use pkg-config sqlite3 --libs to get the appropriate linker flags.

Upvotes: 1

Carl Norum
Carl Norum

Reputation: 224944

These days you can just download the amalgamation and build it in with your project. No more worrying about library locations and architecture matching!

For more details with your exact problem, you'll need to show us the full command line you're using.

Upvotes: 1

Related Questions