undefined reference to `sqlite3_open'
I am a Linux newbie, SQLite3 newbie and C++ newbie.
I have a little C++ program that I am attempting to connect to a test database.
using namespace std;
int main ()
char *zErrMsg = 0;
rc = sqlite3_open( "DBm", & db);
cout << "faileure to open database ";
cout << endl;
When I compile this code, I get the error: undefined reference to `sqlite3_open'
I added sqlite3 package using the command 'apt-get install sqlite3'. Unfortunately the sqlite3.h header file was not installed in /usr/include, so I downloaded the SQLite3 dist., untarred it and copied the sqlite3.h file to /usr/include.
I saw on a previous message that I would need to link the library. The only library file in /usr/lib is libsqlite3.so.0, so the command g++ -lsqlite3 still gives me an error.
Any help is appreciated. I am stabbing in the dark here.