Ogre for iOS 6 and Xcode 4.5.1 boost::thread() error

Discussion of issues specific to mobile platforms such as iOS, Android, Symbian and Meego.
franklinexpress
Gnoblar
Posts: 2
Joined: Mon Oct 29, 2012 10:19 pm

Ogre for iOS 6 and Xcode 4.5.1 boost::thread() error

Post by franklinexpress »

I tried every tutorial out there to get this to work, I seriously don't understand why they can't make a tutorial that actually works, very frustrating.

I'm using the precompiled SDK and the xcode templates and when I try to compile for the simulator I get this:

Code: Select all

Undefined symbols for architecture i386:
  "boost::thread::~thread()", referenced from:
      Ogre::DefaultWorkQueue::shutdown() in libOgreMainStatic.a(OgreDefaultWorkQueueStandard.o)
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I looked through the forums but there is no solution, I tried the recommended options but nothing.

I have -lboost_system and -lboost_thread in the linker flags, the iOS Dependencies in the OgreSDK for iphone folder as well.

Please help, I'm seriously thinking of switching if I'm having this much trouble just to get Ogre to run then I can't imagine what kind of trouble I may have in the future.

I'm trying.
Ologon
Halfling
Posts: 70
Joined: Sun Dec 02, 2007 11:10 am
Location: Italy
x 2

Re: Ogre for iOS 6 and Xcode 4.5.1 boost::thread() error

Post by Ologon »

I had similiar problems and had to recompile boost to support both armv7 and i386. If you search for "XCode boost" you should find a packaged xcode project to compile boost. However, try this:

Code: Select all

lipo -info /PATH_TO_iOSDependecies/lib/libboost_thread.lib


So we can see for what architecture your boost library is compiled for. (Note: armv7 is the iPhone, i386 is the simulator)

PS: This is the xcode project i used to compile boost: https://github.com/downloads/aleph7/a-c ... -boost.zip
You will find a README which explains everything
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: Ogre for iOS 6 and Xcode 4.5.1 boost::thread() error

Post by masterfalcon »

And I just tried building the sample browser and the Xcode template for the iOS simulator using the same dependencies. Besides having to add boost_system, I was not able to reproduce this error.

I have a feeling that this is the result of not having an up to date precompiled SDK. I'll work on that tonight.
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: Ogre for iOS 6 and Xcode 4.5.1 boost::thread() error

Post by masterfalcon »

Ok, I've updated the SDK on the website. You will need to also link with boost_system in the template but otherwise this should resolve the issue for everyone.
Pulas
Halfling
Posts: 61
Joined: Sat Oct 29, 2011 9:39 am

Re: Ogre for iOS 6 and Xcode 4.5.1 boost::thread() error

Post by Pulas »

masterfalcon wrote:Ok, I've updated the SDK on the website. You will need to also link with boost_system in the template but otherwise this should resolve the issue for everyone.
Great! Thanks for your work.
lukmar
Gnoblar
Posts: 1
Joined: Wed Nov 28, 2012 1:12 am

Re: Ogre for iOS 6 and Xcode 4.5.1 boost::thread() error

Post by lukmar »

After adding boost frameworks from OgreSDK folder I get followin linker errors:

Code: Select all

ld: file is universal (3 slices) but does not contain a(n) armv7s slice: /Users/lukas/Xcode_projects/iPhone/Engines/3D/Ogre3D/OgreSDK/iOSDependencies/lib/libboost_thread.a for architecture armv7s
clang: error: linker command failed with exit code 1 (use -v to see invocation)
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: Ogre for iOS 6 and Xcode 4.5.1 boost::thread() error

Post by masterfalcon »

Well when you're right, you're right. Apparently I haven't been building with boost for some time. I'll work on updating the libs tonight and post here and on twitter when they are updated.