Compiling custom SQLite for an iPhone app
Try it with this steps:
- xcode menu -> project -> new target -> static library -> target name: SQLite
- drop SQLite amalgamation source into the project, now you can select the target, choose SQLite
- xcode menu -> project -> edit active target -> tab General -> Direct Dependencies -> add SQLite
- tab General -> Linked Libraries -> add your SQLite
I've managed to do this using the amalgamation and dumped it straight into my project without having to do the linking catlan suggested (I'm not saying it's a bad idea, merely it's possible to do in the main project).
I didn't need to edit anything (except for adding the necessary FTS define for the text searching) and compiled error free. Check your build settings and ensure '-sqlite3' isn't in your Other Linking Flags.
That type of error usually means a missing framework.
- Right- or control-click on your Project's Frameworks folder.
- Select Add > Existing Framework...
- Go to: Macintosh HD > Developer > Platforms > iPhoneOS.platform > Developer > SDKs > iPhoneOS2.2sdk > usr > lib and select libsqlite3.dylib
- Rebuild your project
That should take care of it, I think. You may need to add a similar library for running on the iPhone Simulator.