Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

McBgnr

macrumors regular
Original poster
Apr 13, 2009
144
0
Hello,

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:

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:
Code:
"_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?
 
From sqlite3.h:
The redefinition macros are only valid if the SQLITE_CORE macros is undefined.​
Is that true, do you know?
 
I had something similar. Turns out I forgot to add the sqlite framework to my project.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.