Simple iPhone example using FreePascal and SDL

I’ve made a quick how-to on how to set up a simple iPhone example using FreePascal and SDL and run it with the iPhone simulator.

Please watch in HD. There are englisch and german subtitles available on Youtube.
Video Link on Youtube:
Video Link on Vimeo:

The example source code can be downloaded here:

The SDL 1.3 iPhone header I provide in this example is still incomplete and at best Alpha.

Also I’m using ElysionLogger from the Elysion Frameworks Subversion repository to create a HTML log file in the directory of the application bundle. If you don’t any log files to be created, delete ElysionLogger from the uses clause and any calls that begin with TelLogger.getInstance.

If you rather develop with Lazarus, you might want to try this project file, which allows you to install the application on the iPhone Simulator right out of the Lazarus IDE. You need Lazarus 0.9.29 and the iPhone Laz Extension (


  1. Hi, your source code seems to compile fine but how do I transfer the binary to the simulator? Do you have some XCode project that will do this? I guess it’s some basic almost empty project and then you replace the produced binary. Thanks, Pavel

  2. @Pavel
    I’m not much of a XCode guy when it comes to Pascal programming on a Mac. I tried setting up a XCode project for this example, but it didn’t work for me. I always got the error “Error from Debugger: Failed to launch simulated application: Unknown error.” when starting the iPhone Simulator. I haven’t used XCode that much, so I don’t why this error pops up and how to fix it.

    You might want to try using Lazarus with the iPhone Laz extension ( I got that working for me, it installs the example into the Simulator right out of the Lazarus IDE.
    You can download the Lazarus SDL iPhone example here:

  3. Well… SDL 1.3 is getting a lot of improvements and I hope soon it will have a more stable version! =)

    Did you get something new in this demo?

Leave a Reply