-1

I'm looking for a solution to create an iOS project with C++. Do you know if there is other manners than mix C++ with Objective-C ?

It's for a game written in C++, using some librairies : OpenGL, SDL, ... Do you know if it's possible to use these librairies with an iOS project ?

I found something like this kind of stuff :

http://philjordan.eu/article/mixing-objective-c-c++-and-objective-c++

apgobert
  • 31
  • 6

1 Answers1

3

On this website you'll see in a video how to port your SDL game to iOS.
This link might be useful too; a step by step tutorial on how to use SDL.

This is basically it:

  1. Create a new iPhone view based application project.
  2. Build the SDL libraries statically (libSDL.a and libSDLSimulator.a) for iOS and include them in your project. XCode will ignore the library that is not currently of the correct architecture, hence your app will work both on iPhone and in the iPhone Simulator.
  3. Include the SDL header files in your project. (e.g. #include "SDL.h")
  4. Remove AppDelegate.h and AppDelegate.m -- SDL for iPhone provides its own UIApplicationDelegate. Remove your storyboard -- SDL for iPhone produces its user interface programmatically.
  5. Delete the contents of main.m and program your app as a regular SDL program instead. You may replace main.m with your own main.c, but you must tell XCode not to use the project prefix file, as it includes Objective-C code.