sqlite compile issue

Discussion in 'Mac Programming' started by McBgnr, May 28, 2009.

  1. macrumors regular

    Joined:
    Apr 13, 2009
    #1
    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?
     
  2. Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000
    #2
    From sqlite3.h:
    The redefinition macros are only valid if the SQLITE_CORE macros is undefined.​
    Is that true, do you know?
     
  3. macrumors 68000

    krye

    Joined:
    Aug 21, 2007
    Location:
    USA
    #3
    I had something similar. Turns out I forgot to add the sqlite framework to my project.
     

Share This Page