View Full Version : sqlite compile issue

May 29, 2009, 01:13 AM

I am trying to read data from a sqlite db.

I have added ibsqlite3.0.dylib to my Project. And have been able to open the db successfully.

Further I wanted to execute a query so I am using following code:

const char *sqlStatement = "select * from animals";
sqlite3_stmt *compiledStatement;
if(sqlite3_prepare_v2(database, sqlStatement, -1, &compiledStatement, NULL) == SQLITE_OK) {

I am getting an error while building saying:

"_sqlite3_prepare_v2", referenced from:
-[Controller awakeFromNib] in Controller.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
Build failed (1 error)

Am I missing something here?

May 30, 2009, 10:42 AM
From sqlite3.h:
The redefinition macros are only valid if the SQLITE_CORE macros is undefined.
Is that true, do you know?

May 30, 2009, 11:14 PM
I had something similar. Turns out I forgot to add the sqlite framework to my project.