Build Issue with iOS4.2.1

Discussion of issues specific to mobile platforms such as iOS, Android, Symbian and Meego.
OOPhantom
Gnoblar
Posts: 24
Joined: Thu Sep 16, 2010 9:01 am

Build Issue with iOS4.2.1

Post by OOPhantom »

I have updated to iOS4.2.1SDK and use new Xcode, but I found below problem when I tried to build Ogre. I used Cmake 2.8.0.
(1)In Device Mode, it shows 1 error
/bin/sh -c /SourceCode/OgreIPhoneEx/ogre_src_v1-7-2/build/bin/OGRE.build/Debug-iphoneos/SampleBrowser.build/Script-15C980015C980015C9800000.sh

cp /SourceCode/OgreIPhoneEx/ogre_src_v1-7-2/build/bin/*.cfg /SourceCode/OgreIPhoneEx/ogre_src_v1-7-2/build/bin/Debug/SampleBrowser.app/
usage: cp [-R [-H | -L | -P]] [-f | -i | -n] [-apvX] source_file target_file
cp [-R [-H | -L | -P]] [-f | -i | -n] [-apvX] source_file ... target_directory
make: *** [SampleBrowser_buildpart_0] Error 64
Command /bin/sh failed with exit code 2
(2)In Simulator Mode, it shows 2 errors
ld: file not found: /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.2.sdk/usr/lib/umbrella/IOKit.host
collect2: ld returned 1 exit status
Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/g++-4.2 failed with exit code 1

cp /SourceCode/OgreIPhoneEx/ogre_src_v1-7-2/build/bin/*.cfg /SourceCode/OgreIPhoneEx/ogre_src_v1-7-2/build/bin/Debug/SampleBrowser.app/
usage: cp [-R [-H | -L | -P]] [-f | -i | -n] [-apvX] source_file target_file
cp [-R [-H | -L | -P]] [-f | -i | -n] [-apvX] source_file ... target_directory
make: *** [SampleBrowser_buildpart_0] Error 64
Command /bin/sh failed with exit code 2
(3)I have use svn to get the default, I think it is the current development branch, Is it 1.8? And is it the same as Murial
But I still cannot launch Simulator, I can use device mode.
For simulator, I have no the make error. Do I need to update Cmake?

I have tried to disable Thumb, and remove all build files and tried again. It still shows above error. Since 4.2.1 is a stable version of Apple, can anyone help me? For the simulator mode, I have never success-ed in build Simulator Mode Ogre.

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: Build Issue with iOS4.2.1

Post by masterfalcon »

I would try upgrading to CMake 2.8.3 and try again.
OOPhantom
Gnoblar
Posts: 24
Joined: Thu Sep 16, 2010 9:01 am

Re: Build Issue with iOS4.2.1

Post by OOPhantom »

I tried cmake2.8.3, and use Simulator mode, I deleted all existed files and build again, I got the same 2 errors.
Would you please help about this?
OOPhantom
Gnoblar
Posts: 24
Joined: Thu Sep 16, 2010 9:01 am

Re: Build Issue with iOS4.2.1

Post by OOPhantom »

In additional, it always shows
ld: file not found: /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.2.sdk/usr/lib/umbrella/IOKit.host
collect2: ld returned 1 exit status
Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/g++-4.2 failed with exit code 1

I checked my system, it has no this file?
What does this file use for? Do you have this file?

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: Build Issue with iOS4.2.1

Post by masterfalcon »

This seems like a bug in the 4.2 SDK installer. I fixed it by running this from Terminal:

Code: Select all

sudo ln -s /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.2.sdk/System/Library/Frameworks/IOKit.framework/umbrella/IOKit.host /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit
This appears to be what is being done in the SDK's with Xcode 4 and has worked for me.
OOPhantom
Gnoblar
Posts: 24
Joined: Thu Sep 16, 2010 9:01 am

Re: Build Issue with iOS4.2.1

Post by OOPhantom »

Currently I used Xcode3.2.5 and iOS SDK4.2.
I used several previous version of iOS SDK, but I directly install them directly and didn't uninstall previous version. I don't know if this causes the problem.

I will try the ln command and try again.
pratty70
Gnome
Posts: 341
Joined: Thu May 13, 2004 4:52 pm
Location: Wales - UK

Re: Build Issue with iOS4.2.1

Post by pratty70 »

I just removed the IOKit dependency and it worked....
OOPhantom
Gnoblar
Posts: 24
Joined: Thu Sep 16, 2010 9:01 am

Re: Build Issue with iOS4.2.1

Post by OOPhantom »

I use ln and tried again, the ln command result said file already existed. And the error still existed.

Hi pratty70,
How do you remove that dependency? Would you please tell me some detail?

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: Build Issue with iOS4.2.1

Post by masterfalcon »

Oh, I'm sorry, I gave you the wrong ln command.

Code: Select all

sudo ln -s /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.2.sdk/usr/lib/umbrella/IOKit.host /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.2.sdk/System/Library/Frameworks/IOKit.framework/umbrella/IOKit.host
OOPhantom
Gnoblar
Posts: 24
Joined: Thu Sep 16, 2010 9:01 am

Re: Build Issue with iOS4.2.1

Post by OOPhantom »

Hi masterfalcon,
I tried new ln command, the errors are still there.
And from make error, I tried to update cmake2.8.0 to cmake2.8.3. After build 1.8, the errors are the same I listed above.
I think it maybe some bug in cmake2.8.3.

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: Build Issue with iOS4.2.1

Post by masterfalcon »

It might be worth trying to uninstall Xcode and reinstall. I've had to do this a time or two before. Especially with how rapidly things have changed in the iOS development world it's easy for installations to get messed up. They seem to be getting to more stable dev environment now though.
OOPhantom
Gnoblar
Posts: 24
Joined: Thu Sep 16, 2010 9:01 am

Re: Build Issue with iOS4.2.1

Post by OOPhantom »

The make problem is caused by cmake version update
The IOKit.host issue is fixed by ln command, and then Simulator can correctly launch now.
I reinstall my Mac OS X and directly install cmake 2.8.3 to fix the problems. Now this problem can be Closed.
User avatar
goshua
Halfling
Posts: 92
Joined: Wed Jun 01, 2005 10:33 am

Re: Build Issue with iOS4.2.1

Post by goshua »

- first i tried the SDK for iPhone but it didn't function : i uncompressed the SDK then tried to run the xcode project but it failed to compile

- then i downloaded ogre with : svn co https://svn.ogre3d.org/svnroot/ogre/trunk ogre
- then i tried to compile following : http://ogre3d.org/tikiwiki/tiki-index.p ... %20iPhone)

but i have the same problem, iOS SDK 4.2 & cmake 2.8.3

PhaseScriptExecution "CMake PostBuild Rules" build/Samples/Browser/OGRE.build/Release-iphoneos/SampleBrowser.build/Script-1968D901968D901968D90000.sh
...
/bin/sh -c /Users/Tyua/Code/3rdParty/ogre/build/Samples/Browser/OGRE.build/Release-iphoneos/SampleBrowser.build/Script-1968D901968D901968D90000.sh

cp /Users/Tyua/Code/3rdParty/ogre/build/bin/*.cfg /Users/Tyua/Code/3rdParty/ogre/build/bin/Release-iphoneos/SampleBrowser.app/
usage: cp [-R [-H | -L | -P]] [-f | -i | -n] [-apvX] source_file target_file
cp [-R [-H | -L | -P]] [-f | -i | -n] [-apvX] source_file ... target_directory
make: *** [SampleBrowser_buildpart_0] Error 64
Command /bin/sh failed with exit code 2


i tried your upper ln command masterfalcon
i then had :

ln: /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.2.sdk/System/Library/Frameworks/IOKit.framework/umbrella/IOKit.host: File exists

and it didn't solve the problem, what can i try now ?
appart from reinstalling snow leopard ?? since i wont
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: Build Issue with iOS4.2.1

Post by masterfalcon »

Reinstalling Snow Leopard is totally unnecessary, so don't worry about that.

In the short term, removing -lIOKit from the SampleBrowser LDFLAGS will step around that other error. I'll look into fixing it in the official SDK.

Are there any .cfg files in /Users/Tyua/Code/3rdParty/ogre/build/bin/? Does /Users/Tyua/Code/3rdParty/ogre/build/bin/Release-iphoneos/SampleBrowser.app/ exist? Several people have seen this error but I have not yet heard what files are causing the error.
User avatar
goshua
Halfling
Posts: 92
Joined: Wed Jun 01, 2005 10:33 am

Re: Build Issue with iOS4.2.1

Post by goshua »

i have in ogre/build/bin :
- plugins.cfg
- quakemap.cfg
- Release/Samplebrowser.app
- resources.cfg
- samples.cfg

edit : i have removed the IOKit flag but it still fails to compile
edit 2 : i have 704 errors when i try to compile the iOS SDK 4.1 / 1.7.2 version
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: Build Issue with iOS4.2.1

Post by masterfalcon »

Are you trying to build from source or using the prebuilt SDK?
User avatar
goshua
Halfling
Posts: 92
Joined: Wed Jun 01, 2005 10:33 am

Re: Build Issue with iOS4.2.1

Post by goshua »

i am trying with both, following tutorial/wiki each time

edit : from an old conversation we had masterfalcon, i just tried to pull some fresh version with mercurial http://www.ogre3d.org/developers/mercurial
and it compiles & runs :)
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: Build Issue with iOS4.2.1

Post by masterfalcon »

Have you tried deleting the Ogre sources, SDK and dependencies then starting fresh? I'm grasping at straws here since I can't reproduce this on my own machine.
User avatar
goshua
Halfling
Posts: 92
Joined: Wed Jun 01, 2005 10:33 am

Re: Build Issue with iOS4.2.1

Post by goshua »

masterfalcon wrote:Have you tried deleting the Ogre sources, SDK and dependencies then starting fresh? I'm grasping at straws here since I can't reproduce this on my own machine.
yup i tried several times, but with the mercurial repository & last source version & dependencies i have no problem :)
i already had this problem in may, and at that time i solved the problem by using mercurial to grab the source code as well
the problem is in post build scripts but i cant tell you where soz

edit : problem i have now is that templates dont recognize my ogre directory as ogre sdk path
edit2 : i succeed to install the last released sdk with the template installer, but the generated code fails to compile, i had to force to ios4.2 and sdk 4.2.1 in pbxproj but now i have the following problem :


CompileC build/Test3D.build/Debug-iphoneos/Test3D.build/Objects-normal/armv7/main.o Classes/main.cpp normal armv7 objective-c++ com.apple.compilers.gcc.4_2
cd /Users/Tyua/Code/Test3D
setenv LANG en_US.US-ASCII
setenv PATH "/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc-4.2 -x objective-c++ -arch armv7 -fmessage-length=0 -pipe -Wno-trigraphs -fpascal-strings -O0 -Wreturn-type -Wunused-variable -DDEBUG -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.2.sdk -fvisibility-inlines-hidden -gdwarf-2 -mthumb -miphoneos-version-min=4.2.1 -iquote /Users/Tyua/Code/Test3D/build/Test3D.build/Debug-iphoneos/Test3D.build/Test3D-generated-files.hmap -I/Users/Tyua/Code/Test3D/build/Test3D.build/Debug-iphoneos/Test3D.build/Test3D-own-target-headers.hmap -I/Users/Tyua/Code/Test3D/build/Test3D.build/Debug-iphoneos/Test3D.build/Test3D-all-target-headers.hmap -iquote /Users/Tyua/Code/Test3D/build/Test3D.build/Debug-iphoneos/Test3D.build/Test3D-project-headers.hmap -F/Users/Tyua/Code/Test3D/build/Debug-iphoneos -I/Users/Tyua/Code/Test3D/build/Debug-iphoneos/include -I/Users/Tyua/Code/3rdParty/OgreSDK/iPhoneDependencies/include -I/Users/Tyua/Code/3rdParty/OgreSDK/include/OGRE -I/Users/Tyua/Code/3rdParty/OgreSDK/include/OGRE/Plugins/BSPSceneManager -I/Users/Tyua/Code/3rdParty/OgreSDK/include/OGRE/Plugins/OctreeSceneManager -I/Users/Tyua/Code/3rdParty/OgreSDK/include/OGRE/Plugins/OctreeZone -I/Users/Tyua/Code/3rdParty/OgreSDK/include/OGRE/Plugins/ParticleFX -I/Users/Tyua/Code/3rdParty/OgreSDK/include/OGRE/Plugins/PCZSceneManager -I/Users/Tyua/Code/3rdParty/OgreSDK/include/OGRE/iPhone -I/Users/Tyua/Code/3rdParty/OgreSDK/include/OGRE/RenderSystems/GLES -I/Users/Tyua/Code/3rdParty/OgreSDK/include/OGRE/RenderSystems/GLES/APPLE -I/Users/Tyua/Code/Test3D/build/Test3D.build/Debug-iphoneos/Test3D.build/DerivedSources/armv7 -I/Users/Tyua/Code/Test3D/build/Test3D.build/Debug-iphoneos/Test3D.build/DerivedSources -include /var/folders/7x/7xWIDjfSFyqsoKa0WaEyz++++TI/-Caches-/com.apple.Xcode.501/SharedPrecompiledHeaders/Test3D_Prefix-hkstanvfwspzpecpeuqwkjyskjdf/Test3D_Prefix.pch -c /Users/Tyua/Code/Test3D/Classes/main.cpp -o /Users/Tyua/Code/Test3D/build/Test3D.build/Debug-iphoneos/Test3D.build/Objects-normal/armv7/main.o

{standard input}:782:branch out of range
{standard input}:776:branch out of range
{standard input}:770:branch out of range
{standard input}:764:branch out of range
{standard input}:758:branch out of range
{standard input}:752:branch out of range
{standard input}:746:branch out of range
{standard input}:740:branch out of range
{standard input}:734:branch out of range
{standard input}:727:branch out of range
{standard input}:716:branch out of range
Command /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc-4.2 failed with exit code 1

...


edit 3 : from that post
http://www.ogre3d.org/forums/viewtopic.php?f=2&t=57086
i removed thumbs as compiling option
i still have 1 error when i compile :

Ld build/Debug-iphoneos/Test3D.app/Test3D normal armv7
cd /Users/Tyua/Code/Test3D
setenv IPHONEOS_DEPLOYMENT_TARGET 4.2.1
setenv PATH "/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/g++-4.2 -arch armv7 -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.2.sdk -L/Users/Tyua/Code/Test3D/build/Debug-iphoneos -L/Users/Tyua/Code/3rdParty/OgreSDK/lib/release -L/Users/Tyua/Code/3rdParty/OgreSDK/iPhoneDependencies/lib/release -F/Users/Tyua/Code/Test3D/build/Debug-iphoneos -filelist /Users/Tyua/Code/Test3D/build/Test3D.build/Debug-iphoneos/Test3D.build/Objects-normal/armv7/Test3D.LinkFileList -dead_strip -miphoneos-version-min=4.2.1 -framework Foundation -framework UIKit -framework OpenGLES -framework QuartzCore -lboost_date_time -lboost_thread -lFreeImage -lFreeType -lOIS -lzzip -lOgreMainStatic -lRenderSystem_GLESStatic -lPlugin_BSPSceneManagerStatic -lPlugin_OctreeSceneManagerStatic -lPlugin_ParticleFXStatic -o /Users/Tyua/Code/Test3D/build/Debug-iphoneos/Test3D.app/Test3D

ld: library not found for -lboost_date_time
collect2: ld returned 1 exit status
Command /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/g++-4.2 failed with exit code 1




edit 4 : i then copied the libs libboost_date_time.a and libboost_thread.a from OgreSDK/iPhoneDependencies/lib to OgreSDK/iPhoneDependencies/lib/Debug & OgreSDK/iPhoneDependencies/lib/Release (i hate xcode path declaration)

.. and
.. it functions ! :D

sample launches, well not on the good screen orientation, i'll sort that tomorrow :P

edit 5 : i have changed the paths in pbxproj from the generated template pointing to the ogre sdk, to use now the version i compiled from the mercurial repository, that way i can update ogre from the repository so i have the last version of the code and can update when a new version is committed
azrialelf
Gremlin
Posts: 155
Joined: Wed Jul 11, 2007 2:43 am
x 7

Re: Build Issue with iOS4.2.1

Post by azrialelf »

masterfalcon wrote:In the short term, removing -lIOKit from the SampleBrowser LDFLAGS will step around that other error. I'll look into fixing it in the official SDK.
I am having the same error, how do I go about removing IOKIT from the SampleBrowser LDFLAGS?
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: Build Issue with iOS4.2.1

Post by masterfalcon »

There are 2 ways. Open the SampleBrowser target properties, find Other Linker Flags. Remove -lIOKit. Or update to the latest 1.7 sources, I submitted the fix yesterday.
azrialelf
Gremlin
Posts: 155
Joined: Wed Jul 11, 2007 2:43 am
x 7

Re: Build Issue with iOS4.2.1

Post by azrialelf »

Sigh... Well that sounded simple enough, but when I try and edit the "other linker flags" property, all I see is '<multiple values>' (I don't see the individual flags). How can I remove just the IOKIT link individually ?

Sorry for the mundane questions : (
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: Build Issue with iOS4.2.1

Post by masterfalcon »

Chances are that you're seeing that because the values of that property are not the same for every configuration(probably absolute paths). So if you choose a config from the dropdown near the top other than All, hopefully you should see a meaningful value that you can edit.
azrialelf
Gremlin
Posts: 155
Joined: Wed Jul 11, 2007 2:43 am
x 7

Re: Build Issue with iOS4.2.1

Post by azrialelf »

Well, I was able to successfully build 1.8 I think... There were no errors, and it launched the sample browser in the simulator. However, the sample browser crashes back to the simulator desktop after the Ogre loading screen.
Does this matter?
bstafford
Gnoblar
Posts: 15
Joined: Sat Jan 08, 2011 12:33 am

Re: Build Issue with iOS4.2.1

Post by bstafford »

I get the same problem when trying to run SampleBrowser under 4.2 in the simulator - it terminates suddenly during load (the last console output is "Parsing script bug.material"). Is this a known issue?

Thanks,
Brian