Help me about OgreSDK under iPhoneOS4

Discussion of issues specific to mobile platforms such as iOS, Android, Symbian and Meego.
dkxw
Gnoblar
Posts: 4
Joined: Sun May 16, 2010 7:10 am

Help me about OgreSDK under iPhoneOS4

Post by dkxw »

Hi,I use the latest ogresdk.
It worked well on iPhone3.2 SDK.
Few days ago ,I installed iPhone 4.0 SDK
When i build my project on both iPhoneOS3.2 and iPhoneOS 4.0, I got these errors.
Undefined symbols:
".objc_class_name_NSAutoreleasePool", referenced from:
literal-pointer@__OBJC@__cls_refs@NSAutoreleasePool in libRenderSystem_GLESStatic.a(OgreEAGLWindow.o)
".objc_class_name_UIWindow", referenced from:
literal-pointer@__OBJC@__cls_refs@UIWindow in libRenderSystem_GLESStatic.a(OgreEAGLWindow.o)
".objc_class_name_UIView", referenced from:
.objc_class_name_EAGLView in libRenderSystem_GLESStatic.a(OgreEAGLWindow.o)
".objc_class_name_CAEAGLLayer", referenced from:
literal-pointer@__OBJC@__cls_refs@CAEAGLLayer in libRenderSystem_GLESStatic.a(OgreEAGLWindow.o)
".objc_class_name_EAGLContext", referenced from:
literal-pointer@__OBJC@__cls_refs@EAGLContext in libRenderSystem_GLESStatic.a(OgreEAGLESContext.o)
".objc_class_name_NSDictionary", referenced from:
literal-pointer@__OBJC@__cls_refs@NSDictionary in libRenderSystem_GLESStatic.a(OgreEAGLWindow.o)
".objc_class_name_NSNumber", referenced from:
literal-pointer@__OBJC@__cls_refs@NSNumber in libRenderSystem_GLESStatic.a(OgreEAGLWindow.o)
".objc_class_name_UIScreen", referenced from:
literal-pointer@__OBJC@__cls_refs@UIScreen in libRenderSystem_GLESStatic.a(OgreEAGLSupport.o)
literal-pointer@__OBJC@__cls_refs@UIScreen in libRenderSystem_GLESStatic.a(OgreEAGLWindow.o)
ld: symbol(s) not found
collect2: ld returned 1 exit status

I have added UIKit.framework OpenGLES.framework and so on. But it still donesn't work..
User avatar
masterfalcon
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 4270
Joined: Sun Feb 25, 2007 4:56 am
Location: Bloomington, MN
x 126

Re: Help me about OgreSDK under iPhoneOS4

Post by masterfalcon »

dkxw
Gnoblar
Posts: 4
Joined: Sun May 16, 2010 7:10 am

Re: Help me about OgreSDK under iPhoneOS4

Post by dkxw »

I used the latest dependencies on sourceforge
http://sourceforge.net/projects/ogre/fi ... g/download
Is it the same thing on dropbox,I can't visit dropbox in china.
The ois lib can works well with the iOS 4.0 dependencies.
But the link error comes from libRenderSystem_GLSLStatic.a.
User avatar
masterfalcon
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 4270
Joined: Sun Feb 25, 2007 4:56 am
Location: Bloomington, MN
x 126

Re: Help me about OgreSDK under iPhoneOS4

Post by masterfalcon »

At the moment, you will need to build from source to use the iOS 4 SDK. The current prebuilt OGRE libraries are not compatible with the new iOS SDK.
jlobraco
Gnoblar
Posts: 3
Joined: Tue Jul 13, 2010 12:23 am

Re: Help me about OgreSDK under iPhoneOS4

Post by jlobraco »

Hi masterfalcon,

When you say that we need to build from source for the iOS 4 SDK, are you referring to just the Ogre3D source, or all of the dependencies as well? The reason I ask is that I am getting the same linker errors using both a downloaded prebuilt SDK and a version I built myself from the 1.7.1 stable sources.

Thanks,
Joe
User avatar
masterfalcon
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 4270
Joined: Sun Feb 25, 2007 4:56 am
Location: Bloomington, MN
x 126

Re: Help me about OgreSDK under iPhoneOS4

Post by masterfalcon »

Joe,

Just Ogre. Also, make sure that when you build it, you have selected the iOS 4 SDK and that the iOS Deployment Target is set to 4.0.
User avatar
AticAtac
Halfling
Posts: 72
Joined: Sat Sep 24, 2005 10:19 am
Location: Germany

Re: Help me about OgreSDK under iPhoneOS4

Post by AticAtac »

I got a (possibly stupid) question:
programming with ogre3d for iphone is only done in objective-c ?
Which compiler and languages can be used?

Thanks for enlighting a iphone/mac newbie :)
Nefbrethilion
Gnoblar
Posts: 24
Joined: Mon Dec 14, 2009 12:15 pm

Re: Help me about OgreSDK under iPhoneOS4

Post by Nefbrethilion »

Programming with Ogre is done is c++ as usual. But talking (e.g. starting the application and input) with the iPhone is done in objective-c . Only some lines of objective-c are required to get an Ogre application written in C++ to work on the iPhone.

Masterfalcon, I upgraded to iOS4 and rebuild the ogre sources with the latest dependencies. However, when I use the libraries in my project I get the following errors:

Code: Select all

  ".objc_class_name_CAEAGLLayer", referenced from:


      literal-pointer@__OBJC@__cls_refs@CAEAGLLayer in libRenderSystem_GLESStatic.a(OgreEAGLWindow.o)


  ".objc_class_name_NSNumber", referenced from:


      literal-pointer@__OBJC@__cls_refs@NSNumber in libRenderSystem_GLESStatic.a(OgreEAGLWindow.o)


  ".objc_class_name_NSAutoreleasePool", referenced from:


      literal-pointer@__OBJC@__cls_refs@NSAutoreleasePool in libRenderSystem_GLESStatic.a(OgreEAGLWindow.o)


  ".objc_class_name_UIView", referenced from:


      .objc_class_name_InputDelegate in libOIS.a(iPhoneInputManager.o)


      .objc_class_name_EAGLView in libRenderSystem_GLESStatic.a(OgreEAGLWindow.o)


  ".objc_class_name_UIScreen", referenced from:


      literal-pointer@__OBJC@__cls_refs@UIScreen in libOIS.a(iPhoneInputManager.o)


      literal-pointer@__OBJC@__cls_refs@UIScreen in libRenderSystem_GLESStatic.a(OgreEAGLSupport.o)


      literal-pointer@__OBJC@__cls_refs@UIScreen in libRenderSystem_GLESStatic.a(OgreEAGLWindow.o)


  ".objc_class_name_EAGLContext", referenced from:


      literal-pointer@__OBJC@__cls_refs@EAGLContext in libRenderSystem_GLESStatic.a(OgreEAGLESContext.o)


  ".objc_class_name_NSDictionary", referenced from:


      literal-pointer@__OBJC@__cls_refs@NSDictionary in libRenderSystem_GLESStatic.a(OgreEAGLWindow.o)


  ".objc_class_name_UIApplication", referenced from:


      literal-pointer@__OBJC@__cls_refs@UIApplication in libOIS.a(iPhoneInputManager.o)


  ".objc_class_name_UIWindow", referenced from:


      literal-pointer@__OBJC@__cls_refs@UIWindow in libRenderSystem_GLESStatic.a(OgreEAGLWindow.o)


  ".objc_class_name_UIAccelerometer", referenced from:


      literal-pointer@__OBJC@__cls_refs@UIAccelerometer in libOIS.a(iPhoneInputManager.o)


      literal-pointer@__OBJC@__cls_refs@UIAccelerometer in libOIS.a(iPhoneAccelerometer.o)


ld: symbol(s) not found


collect2: ld returned 1 exit status

These are RenderSystem_GLES AND OIS errors - I copied the OIS.a library from the latest iOS4 dependencies. So I fear there's something still wrong :-o
User avatar
masterfalcon
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 4270
Joined: Sun Feb 25, 2007 4:56 am
Location: Bloomington, MN
x 126

Re: Help me about OgreSDK under iPhoneOS4

Post by masterfalcon »

What is the Base SDK version set to in your project? How about the Target Deployment version?
Nefbrethilion
Gnoblar
Posts: 24
Joined: Mon Dec 14, 2009 12:15 pm

Re: Help me about OgreSDK under iPhoneOS4

Post by Nefbrethilion »

Both are 4.0 :-(
User avatar
masterfalcon
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 4270
Joined: Sun Feb 25, 2007 4:56 am
Location: Bloomington, MN
x 126

Re: Help me about OgreSDK under iPhoneOS4

Post by masterfalcon »

Got a couple things to try. Just trying to feel out what could the the issue. Is this for Device or Simulator? And what happens if you target an earlier version of the OS(will require rebuilding Ogre).
Nefbrethilion
Gnoblar
Posts: 24
Joined: Mon Dec 14, 2009 12:15 pm

Re: Help me about OgreSDK under iPhoneOS4

Post by Nefbrethilion »

Hi,
As usual, thanks for looking into this, certainly so fast :-)

It is for Simulator. Changing the deployment version does not require a rebuild. I changed the SDK to 3.2 and still the same errors occur:

Code: Select all

  ".objc_class_name_CAEAGLLayer", referenced from:


      literal-pointer@__OBJC@__cls_refs@CAEAGLLayer in libRenderSystem_GLESStatic.a(OgreEAGLWindow.o)


  ".objc_class_name_NSNumber", referenced from:


      literal-pointer@__OBJC@__cls_refs@NSNumber in libRenderSystem_GLESStatic.a(OgreEAGLWindow.o)


  ".objc_class_name_NSAutoreleasePool", referenced from:


      literal-pointer@__OBJC@__cls_refs@NSAutoreleasePool in libRenderSystem_GLESStatic.a(OgreEAGLWindow.o)


  ".objc_class_name_UIView", referenced from:


      .objc_class_name_InputDelegate in libOIS.a(iPhoneInputManager.o)


      .objc_class_name_EAGLView in libRenderSystem_GLESStatic.a(OgreEAGLWindow.o)


  ".objc_class_name_UIScreen", referenced from:


      literal-pointer@__OBJC@__cls_refs@UIScreen in libOIS.a(iPhoneInputManager.o)


      literal-pointer@__OBJC@__cls_refs@UIScreen in libRenderSystem_GLESStatic.a(OgreEAGLSupport.o)


      literal-pointer@__OBJC@__cls_refs@UIScreen in libRenderSystem_GLESStatic.a(OgreEAGLWindow.o)


  ".objc_class_name_EAGLContext", referenced from:


      literal-pointer@__OBJC@__cls_refs@EAGLContext in libRenderSystem_GLESStatic.a(OgreEAGLESContext.o)


  ".objc_class_name_NSDictionary", referenced from:


      literal-pointer@__OBJC@__cls_refs@NSDictionary in libRenderSystem_GLESStatic.a(OgreEAGLWindow.o)


  ".objc_class_name_UIApplication", referenced from:


      literal-pointer@__OBJC@__cls_refs@UIApplication in libOIS.a(iPhoneInputManager.o)


  ".objc_class_name_UIWindow", referenced from:


      literal-pointer@__OBJC@__cls_refs@UIWindow in libRenderSystem_GLESStatic.a(OgreEAGLWindow.o)


  ".objc_class_name_UIAccelerometer", referenced from:


      literal-pointer@__OBJC@__cls_refs@UIAccelerometer in libOIS.a(iPhoneInputManager.o)


      literal-pointer@__OBJC@__cls_refs@UIAccelerometer in libOIS.a(iPhoneAccelerometer.o)


ld: symbol(s) not found


collect2: ld returned 1 exit status



User avatar
masterfalcon
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 4270
Joined: Sun Feb 25, 2007 4:56 am
Location: Bloomington, MN
x 126

Re: Help me about OgreSDK under iPhoneOS4

Post by masterfalcon »

I'm thinking that you may need to use the latest test dependencies for iOS 4. The link is here: http://sourceforge.net/projects/ogre/fi ... g/download
Nefbrethilion
Gnoblar
Posts: 24
Joined: Mon Dec 14, 2009 12:15 pm

Re: Help me about OgreSDK under iPhoneOS4

Post by Nefbrethilion »

Oddly enough, those are the ones I'm using, I even double checked in CMake that they were found.

Also, I just copied the OIS.a from those dependencies to my project and there are errors about it too... strangely enough.

Can I try to build OIS myself? Or do you have any more hints?

Thanks,
User avatar
masterfalcon
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 4270
Joined: Sun Feb 25, 2007 4:56 am
Location: Bloomington, MN
x 126

Re: Help me about OgreSDK under iPhoneOS4

Post by masterfalcon »

It is possible that some target settings are overriding project settings in your Xcode project. Maybe double check them too since target settings always take precedence over project settings.

Oh, and is the Base SDK set to 4.0 Simulator or device? I remember something about the Simulator SDK not getting some of the new deployment target goodies due to time.
Nefbrethilion
Gnoblar
Posts: 24
Joined: Mon Dec 14, 2009 12:15 pm

Re: Help me about OgreSDK under iPhoneOS4

Post by Nefbrethilion »

Whoops, some search paths where pointing to old folders, with older builds. It's working now :-)

Atlast, back to developing! :-D

Thanks,
jlobraco
Gnoblar
Posts: 3
Joined: Tue Jul 13, 2010 12:23 am

Re: Help me about OgreSDK under iPhoneOS4

Post by jlobraco »

I too have it working now. I must have missed something the first time around, because I ended up just rebuilding Ogre (after wiping my previous attempts) and all is well now.

Thanks masterfalcon for all the help. Much appreciated.

Joe
User avatar
AticAtac
Halfling
Posts: 72
Joined: Sat Sep 24, 2005 10:19 am
Location: Germany

Re: Help me about OgreSDK under iPhoneOS4

Post by AticAtac »

I have setup now a snow leopard mac and also downloaded the iphone sdk.
Could someone give a step/by/step instructions which packages i need to download and how to build them?
(i prefer prebuilt sdk)
many thx in advance

Atic
jlobraco
Gnoblar
Posts: 3
Joined: Tue Jul 13, 2010 12:23 am

Re: Help me about OgreSDK under iPhoneOS4

Post by jlobraco »

Atic,

I believe that for the iPhone you must build from source.

You will need CMake. You can download a prebuilt version from here http://www.cmake.org/cmake/resources/software.html (I have version 2.6.4, but I believe that 2.8.0 works, but 2.8.1 and 2.8.2 do not currently work at this time).

You can download Ogre from the usual place (http://www.ogre3d.org/download/source). Get the 1.7.1 source tarball for Linux/OSX.

You will also need the iPhoneDependencies (i believe the latest ones masterfalcon suggested to use are here http://dl.dropbox.com/u/6704444/Ogre_iO ... 100702.dmg

Once you have all CMake installed and the above 2 things downloaded follow the instructions in this wiki page http://www.ogre3d.org/tikiwiki/Building ... %20iPhone) EXACTLY.

There is 2 things that initially tripped me up:

1) After you open the OGRE.xcodeproj in Xcode, right click on the OGRE project and choose Get Info. On the "General" tab at the bottom you will see an option to choose the Base SDK for All Configurations. You want to make sure this is iPhone Device 4.0.

2) Click on the Build tab in that same window. A little ways down the list of options, under the Deployment heading, you will see an option called iPhone OS Deployment Target, there you should choose the minimum version of iPhone OS you would like to support. (Make sure you do this for both the Release and Debug configurations).

Once you have done those 2 steps, you can build OGRE. Then follow the rest of the instructions in the wiki page I linked to above, and you should be good to go.

This is the process that worked for me. I am able to run the SampleBroswer in the iPhone simulator as well as on my development device.

I still have one problem though. That is that when trying to run any Orge app that has zip file resources, the app crashes when run in the iPad simulator (haven't tried it on an actual iPad yet cause I don't have one). I am still trying to figure that one out.

Hope this helps,
Joe
User avatar
AticAtac
Halfling
Posts: 72
Joined: Sat Sep 24, 2005 10:19 am
Location: Germany

Re: Help me about OgreSDK under iPhoneOS4

Post by AticAtac »

Many thanks ! I will try it!

Btw., anyone else has here experiences with SnowLeopard + iphonesdk+ogre3d in vmware ?
User avatar
masterfalcon
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 4270
Joined: Sun Feb 25, 2007 4:56 am
Location: Bloomington, MN
x 126

Re: Help me about OgreSDK under iPhoneOS4

Post by masterfalcon »

I've seen that crash on iPad with zip files too. I traced it as far back into zziplib as I could and noticed that it's getting a bad value for the size of the file, though I have no idea why it's only on iPads.
odbb
Gnoblar
Posts: 3
Joined: Fri Aug 06, 2010 9:53 am
Location: Austria

Re: Help me about OgreSDK under iPhoneOS4

Post by odbb »

Hi there,

I tried to get the build done following the description above.

Installing Cmake 2.8, Installing ogre_src_v1-7-1 on Desktop and addingOgreDependencies_iPhone_20091230.dmg.
Making the project using Terminal:

mkdir build && cd build
cmake -D OGRE_BUILD_PLATFORM_IPHONE=1 -G Xcode ..
../SDK/iPhone/fix_linker_paths.sh

Afterwards I open the OGRE.xcodeproj in build folder with Xcode 3.2.3 and change Targetplatform & Base SDK to IPhone OS 4 in simulator and device (debug and release)

After building the Samplebrowser + all ogre libs (dependencies) it gives me 4 errors:

Code: Select all

  ".objc_class_name_UIScreen", referenced from:
      literal-pointer@__OBJC@__cls_refs@UIScreen in libOIS.a(iPhoneInputManager.o)

  ".objc_class_name_UIApplication", referenced from:
      literal-pointer@__OBJC@__cls_refs@UIApplication in libOIS.a(iPhoneInputManager.o)

  ".objc_class_name_UIAccelerometer", referenced from:
      literal-pointer@__OBJC@__cls_refs@UIAccelerometer in libOIS.a(iPhoneInputManager.o)
      literal-pointer@__OBJC@__cls_refs@UIAccelerometer in libOIS.a(iPhoneAccelerometer.o)

  ".objc_class_name_UIView", referenced from:
      .objc_class_name_InputDelegate in libOIS.a(iPhoneInputManager.o)
It may be a linker problem but all linker paths I found are empty so I don't get it where xcode finds it's libraries.
(I'm new to mac/xcode/iphone development so it confuses me a little bit)
Has anyone a suggestion where I could find the specific path to solve the problem?
User avatar
masterfalcon
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 4270
Joined: Sun Feb 25, 2007 4:56 am
Location: Bloomington, MN
x 126

Re: Help me about OgreSDK under iPhoneOS4

Post by masterfalcon »

Look up a few posts. jlobraco has a link to some iOS 4 built dependencies that should solve that problem.
odbb
Gnoblar
Posts: 3
Joined: Fri Aug 06, 2010 9:53 am
Location: Austria

Re: Help me about OgreSDK under iPhoneOS4

Post by odbb »

THX - it works :)

I'm so sorry, I haven't seen that he posted newer dependencies which have not been on sourceforge :!:
Works now with: Iphone 4 SDK + Ogre whole build + Snow Leopard in VMWare
odbb
Gnoblar
Posts: 3
Joined: Fri Aug 06, 2010 9:53 am
Location: Austria

Re: Help me about OgreSDK under iPhoneOS4

Post by odbb »

Hi there again (sorry for double post, but the last entry was done a week ago)
Building worked perfectly for simulator and device for Iphone OS4, but during deploying in simulator mode (or release) of the sample browser, the application opens and after the ogre logo screen it changes to a undefined state where anything may be displayed but not the application (just display memory fragements). After touching any position on screen the app crashes to home screen and debugger tells me: Error from Debugger: The program being debugged it not being run. :roll:

Has anyone got into troubles with this Problems (I'm using a jailbreaked device with slefsining certificate until my credit card arrives, maybe that causes the problem althought other sample apps work :cry: )