Installing OGRE XCode template for iOS

This is the continuation of my previous blog Building OGRE for iOS. To install the template, you need to follow these steps.

OGRE XCode template

This will install the OGRE template for you. Let us create our first sample OGRE demo using the template we installed it now. To do that, open XCode and select the OGRE template and hit next.

OGRE XCode template

If you see the next attached screenshot carefully, for some reason, the XCode was not letting me add ‘/’ at the beginning of the root SDK path of OGRE. Just ignore it for now. Lets correct this later by making few changes in the XCode project settings.XCode project creation

Now, select the target ‘DemoApp’. Now, select ‘Header Search Paths’ under ‘Build Settings’ and add the missing ‘/’ . Also, make the same changes for ‘Library Search Paths’ too 🙂

OGRE demo app project settings

Now. it’s time to compile the app. If you have done everything right then you should see this error 🙂

 

Undefined symbols for architecture i386:
"boost::system::system_category()", referenced from:
__GLOBAL__I_a in main.o
__GLOBAL__I_a in OgreDemoApp.o
__GLOBAL__I_a in OgreFramework.o
boost::unique_lock<boost::recursive_mutex>::lock() in libOgreMainStatic.a(OgreConfigFile.o)
boost::recursive_mutex::recursive_mutex() in libOgreMainStatic.a(OgreConfigFile.o)
__GLOBAL__I_a in libOgreMainStatic.a(OgreConfigFile.o)
__GLOBAL__I_a in libRenderSystem_GLESStatic.a(OgreGLESPlugin.o)
...
"boost::system::generic_category()", referenced from:
__GLOBAL__I_a in main.o
__GLOBAL__I_a in OgreDemoApp.o
__GLOBAL__I_a in OgreFramework.o
__GLOBAL__I_a in libOgreMainStatic.a(OgreConfigFile.o)
__GLOBAL__I_a in libRenderSystem_GLESStatic.a(OgreGLESPlugin.o)
__GLOBAL__I_a in libOgreMainStatic.a(OgreLogManager.o)
__GLOBAL__I_a in libOgreMainStatic.a(OgreQuaternion.o)
...
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

To fix this error, add -lboost_system in the Other Linker Flags. That’s it…Compile and Run the program now. You should see the OGRE beast staring at you 🙂

OGRE Simulator beast

Advertisements

Building OGRE for iOS

I was looking out for a 3D Engine (OpenSource) to render 3D models. I wanted to use Cocos3d but this has few limitations. It is not a cross platform engine. [ I can’t ignore my friend Android 😦 ]. Also, it lacks many of the cool features when compared to sophisticated 3D engines. The next engine was OGRE. This is written C++ and a cross platform engine. Moreover, this is exactly what I was looking for. After downloading the source, the next big task was to compile the source. There are many tutorials available in the website but most them are obsolete. So I thought of writing one myself to help someone to quickly get started with OGRE 🙂

Follow the following steps to compile OGRE on iOS platform:

  • Get the latest source from here(v1.8.1)
  • Download the OGRE iOS dependancy and XCode template from here(1.8)
  • Open the iOS dependancies dmg and copy the folder iOSDependencies to the source folder ogre_src_v1-8-1. Ensure that the iOSDependencies and OgreMain folder are at the same hierarchical level.
  • OGRE folder structure
  • Now, navigate to the SDK -> iOS folder. You should find a make_ios.sh script.iOS script
  • Open the terminal and navigate it to the above folder where the script resides and run the script ./make_ios.sh in the terminal.
  • If everything worked fine then you should see a build folder in the same location where the script was. This folder contains a XCode project. XCode Build folder
  • Launch the  XCode project and set the target to SampleBrowser. Run the project. Wait for the Simulator to launch the OGRE beast 🙂XCode OGRE Project

PS: XCode Version 4.6.1 (4H512) and OS X (10.8.3)