Note
This response was written some time ago and mo longer works with Xcode 6 and up. Please check this link for a more current answer to this problem.
Introduction
Incorporating GDAL into your iOS app is a 5 steps process:
- Download the GDAL source code from the GDAL website
- Run the configure/build/install script given below
- Add the resulting static library into your iOS project along with the include files
- Link with additional libraries in your iOS project
- Start coding... the GDAL and OGR tutorials are good starting points
Downloading GDAL
GDAL is a C++ open source library which can be downloaded from the www.gdal.org web site.
At the time of writing the latest version is 1.9.0. You should download the latest stable version if possible.
Run the script to compile GDAL for iOS and the simulator
In order to use GDAL in your iOS project you need to compile the source code as a static library (.a). With the latest iOS6-supported architecture you should create the static library for the following architectures:
- i386 for the simulator
- armv7 for iPhone 3GS to iPhone 4S
- armv7s for iPhone 5
Base script to build for 1 architecture
The following script, which is adapted from pseudogreen's does the trick of compiling the source code for a single architecture.
Copy paste this code into a text editor and save it as file with .sh extension: for instance build_gdal_ios.sh.
To use it copy the script into the directory where you downloaded the gdal source code and run it as follows:
answered 2012-09-28T16:29:45.360