title: ios sqlite3 linking error
body: <p>I'm starting to develop a small iOS application just for learning, and I'm attempting to use SQLite to store my app data. I'm using a simple CRUD operations, but when I compile the app (I want to try it in the device emulator) i've got this error</p>
  
  <p><img src="https://i.stack.imgur.com/jx7jO.png" alt="enter image description here"></p>
  
  <p>I've added libsqlite3.dylib to my project dependences.</p>
  
  <p><img src="https://i.stack.imgur.com/9pIgm.png" alt="enter image description here"></p>
  
  <p>I've tried many solutions, bun no one fix my problem.
  Any idea about what i'm doing wrong?</p>
  
  <p>Thank you so much</p>
  
  <p>ps. The code are the following:</p>
  
  <pre><code>-(int) getPushCount {
  int count = 0;
  const char *dbpath = [databasePath UTF8String];
  
  if(sqlite3_open(dbpath, &amp;database) == SQLITE_OK) {
      NSString *query = [NSString stringWithFormat:@"SELECT COUNT(*) FROM recived_push WHERE read = 1"];
      const char *getQuery = [query UTF8String];
  
      if(sqlite3_prepare_v2(database, getQuery, -1, &amp;statement, NULL) == SQLITE_OK) {
          while(sqlite_step(statement) == SQLITE_ROW) {
              count = sqlite_column_int(statement,0);
          }
      } else {
          NSLog(@"Failed from sqlite3_prepare_v2.");
          NSLog(@"Error is:  %s", sqlite3_errmsg(database));
      }
  
      sqlite3_finalize(statement);
      sqlite3_close(database);
  
  } else {
      NSLog(@"Oops! Something went terribly wrong...");
      NSLog(@"%s",sqlite3_errmsg(database));
      return nil;
  }
  
  NSLog(@"**Count: %d",count);
  
  return count;
  }
  </code></pre>