Hi there,
I'm starting to make an iOS game using Ogre3D. I built Ogre and its dependencies using XCode without CMake (I got errors, and I wanted to build with llvm and libc++) successfully after a couple of weeks of muddling through it in my evenings. Though I have it.. I don't trust it, because I had to edit some of the source code in Ogre to get it to build for libc++. So, I've gone back to the prebuilt SDK download, I've heard you can't release apps which use 3rd party dylibs - does that mean I eventually will need to build Ogre from source and hardcode the plugins?
Cheers
Joe
iOS apps and static linking
-
- OGRE Retired Team Member
- Posts: 4270
- Joined: Sun Feb 25, 2007 4:56 am
- Location: Bloomington, MN
- x 126
Re: iOS apps and static linking
Well, I'm not sure how you managed to build a dylib for iOS. But yes, you do need to statically link Ogre on iOS.
-
- Gnoblar
- Posts: 15
- Joined: Mon Oct 01, 2012 10:32 am
- x 1
Re: iOS apps and static linking
I didn't build a dylib, I just dragged all the Ogre source code into the XCode project for my game - but as I said, I don't trust that I've done it correctly, and I don't want to come up against some obscure bug which takes weeks to fix, which turns out to be because I built Ogre wrong!masterfalcon wrote:Well, I'm not sure how you managed to build a dylib for iOS. But yes, you do need to statically link Ogre on iOS.
My question is - will I eventually have to compile Ogre from source, so that I can hardcode the plugins? The pre-built SDK for iOS seems to still load plugins at runtime, or am I mistaken?
-
- OGRE Retired Team Member
- Posts: 4270
- Joined: Sun Feb 25, 2007 4:56 am
- Location: Bloomington, MN
- x 126
Re: iOS apps and static linking
It would probably be better to build it from source. And you're right Ogre does load plugins at runtime. But it's not loading them from a dynamic library. The plugins are statically linked and they are initialized at runtime.
-
- Gnoblar
- Posts: 15
- Joined: Mon Oct 01, 2012 10:32 am
- x 1
Re: iOS apps and static linking
Ah I see. Out of interest, why is it better to build from source? Might I run into problems if I'm using libc++ but Ogre and its dependencies are using libstdc++?masterfalcon wrote:It would probably be better to build it from source. And you're right Ogre does load plugins at runtime. But it's not loading them from a dynamic library. The plugins are statically linked and they are initialized at runtime.
-
- OGRE Retired Team Member
- Posts: 4270
- Joined: Sun Feb 25, 2007 4:56 am
- Location: Bloomington, MN
- x 126
Re: iOS apps and static linking
That's definitely possible.
-
- Gnoblar
- Posts: 15
- Joined: Mon Oct 01, 2012 10:32 am
- x 1
Re: iOS apps and static linking
So is that the reason why building from source is better? Or are there other factors? Sorry to ask so many questions, I'm really new to Ogre..masterfalcon wrote:That's definitely possible.
-
- OGRE Retired Team Member
- Posts: 4270
- Joined: Sun Feb 25, 2007 4:56 am
- Location: Bloomington, MN
- x 126
Re: iOS apps and static linking
Just to make it easier to build really. As long as you have your CFLAGS and OgreBuildSettings.h set up right then you could compile it into your own project. You may or may not run into link errors with libc++ and the dependencies, I haven't tried in a while.
-
- Gnoblar
- Posts: 15
- Joined: Mon Oct 01, 2012 10:32 am
- x 1
Re: iOS apps and static linking
Mmkay.. Perhaps I'll tussle with CMake again and try to generate a project again.. As I wrote in this thread I managed to work around the errors I got from building Ogre with libc++ by using boost containers, but at some point it'd be good to have a proper fix. Anyway, thanks for all your help, I've got plenty to crack on with now =)masterfalcon wrote:Just to make it easier to build really. As long as you have your CFLAGS and OgreBuildSettings.h set up right then you could compile it into your own project. You may or may not run into link errors with libc++ and the dependencies, I haven't tried in a while.