On Jan 26, 2006, at 11:03 AM, [EMAIL PROTECTED] wrote:
I'm a novice and after compiled and correctly installed SQLite 3.x,
i've tried to compile sample C++ program found in Quickstart page.
I've
got Linker errors, like follows:
/home/etrax/tmp/cckIV5JC.o: In
function `main':
t.c:(.text+0xd6): undefined reference to
`sqlite3_open'
t.c:(.text+0xee): undefined reference to
`sqlite3_errmsg'
t.c:(.text+0x115): undefined reference to
`sqlite3_close'
t.c:(.text+0x142): undefined reference to
`sqlite3_exec'
t.c:(.text+0x175): undefined reference to
`sqlite3_close'
collect2: ld returned 1 exit status
Any suggestions ?
I've compiled sqlite3 without errors and using sqlite3 I've created
and
I can use a testDB.
Regards
You need to tell the linker that you're using the SQLite library, and
possibly where to find that library.
To tell the linker you're using SQLite, just add to your LDFLAGS '-
lsqlite3'. If the linker still can't seem to find the sqlite3
library, you may also need to add '-L/usr/local/lib' (assuming you
installed SQLite into /usr/local, which is the default destination).
A complete makefile might be as simple as the following line:
LDFLAGS = -L/usr/local/lib -lsqlite3
Then, just 'make t' should compile and link your test program correctly.
HTH,
-MIke Ashmore