Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SQLite3 getting errors in xcode 4.3.2

Tags:

sqlite

xcode

My Application was working perfectly on Snow Leopard with Xcode 4.2. Built with no errors and ran with the SQL database with no problem. I upgraded to Lion and Xcode 4.3.2 and when I Build, I get errors of "/usr/include/sqlite3.h file not found" on my #import "/usr/include/sqlite3.h" lines of code. Any one else have this problem or have any suggestions? I have tried deleting the libsqlite3.dylib from the Project Navigator, and then adding it back via the + sign in the Build Phases tab in the Link Binary With Libraries, but the error persists.

like image 932
Bill Avatar asked May 02 '12 17:05

Bill


1 Answers

When updating from Snow Leopard to Lion and Xcode 4.2 to Xcode 4.5, your will got error: " '/usr/include/sqlite3.h' file not found".

Solution:

  • Add library: "libsqlite3.0.dylib" in the Target > Build Phases

  • Change #import "/usr/include/sqlite3.h" to #import "sqlite.h" in your code


Update to author's post: It is not #import "sqlite.h". It is: #import <sqlite3.h>


like image 68
DavidNg Avatar answered Sep 29 '22 02:09

DavidNg