Building v1.8

Discussion of issues specific to mobile platforms such as iOS, Android, Symbian and Meego.
pratty70
Gnome
Posts: 341
Joined: Thu May 13, 2004 4:52 pm
Location: Wales - UK

Building v1.8

Post by pratty70 »

After far too many months working my fingers to the bone on other stuff - I'm back onto my iOS stuff. Got pretty close to release last time, but it is more of a hobby than a job, so it got pushed to one side.

Back on it with some gusto now and having upgraded to Xcode 4 - decided to also take the plunge and move to Ogre v1.8.

Using the Mercurial 1.8 latest. Have copied in the iPhone Dependencies from my 1.7 build (building dependencies from source) and run cmake. All is good.

Ran up Xcode 4 and built Ogre for release.
If I build ALL_BUILD for Profiling (release)
ld: warning: directory not found for option '-L/Users/chrispratt/dev/ogre/v1.8/iPhoneDependencies/lib/Release-iphoneos'
ld: warning: ignoring file /usr/X11R6/lib/libfreetype.dylib, missing required architecture armv7 in file
"_FT_Done_FreeType", referenced from:
__ZN4Ogre4Font12loadResourceEPNS_8ResourceE in libOgreMainStatic.a(OgreFont.o)
"_FT_Init_FreeType", referenced from:
__ZN4Ogre4Font12loadResourceEPNS_8ResourceE in libOgreMainStatic.a(OgreFont.o)
"_FT_Set_Char_Size", referenced from:
__ZN4Ogre4Font12loadResourceEPNS_8ResourceE in libOgreMainStatic.a(OgreFont.o)
"_FT_Load_Char", referenced from:
__ZN4Ogre4Font12loadResourceEPNS_8ResourceE in libOgreMainStatic.a(OgreFont.o)
"_FT_New_Memory_Face", referenced from:
__ZN4Ogre4Font12loadResourceEPNS_8ResourceE in libOgreMainStatic.a(OgreFont.o)
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Most notably, in my iPhone dependencies I don't have a Release-iphoneos, just a Release.
I still can't get my head around how Apple have changed the mechanism for release and debug to having a scheme and then multiple Release and Debug target directories for each target (iPhone or simulator).
Then I saw on the wiki that should build for SampleBrowser, as ALL_BUILD does not work with Xcode 4.
If I build for SampleBrowser I get the same.

Any thoughts greatly appreciated. I'm a bit rusty on Xcode and 4 is new to me, so forgive any obvious 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: Building v1.8

Post by masterfalcon »

Hmm, do you have the latest prebuilt dependencies? I may have to release an update. It does seem strange that it's trying to link to the X11 free type lib.
pratty70
Gnome
Posts: 341
Joined: Thu May 13, 2004 4:52 pm
Location: Wales - UK

Re: Building v1.8

Post by pratty70 »

Sorry taken me so long to get back on this - pressure of work.

I'm building the dependencies from source using a build you supplied a good while ago for v1.7.

Which are the current pre-built dependencies for v1.8? and can I use the LLVM 3.0 compiler with them or are we still supposed to use GCC 4.2?
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: Building v1.8

Post by masterfalcon »

The latest dependencies posted are still good, I think. I'm working on a new prebuilt and source distro right now. Also, you can use the code at https://bitbucket.org/cabalistic/ogredeps

Yup, you can use LLVM 3 as well.
pratty70
Gnome
Posts: 341
Joined: Thu May 13, 2004 4:52 pm
Location: Wales - UK

Re: Building v1.8

Post by pratty70 »

Thanks masterfalcon, usual story - been too busy to pick this up again, but I am now. Thanks for that, going to have a play with it - see if I can get a total successful build.
Cheers.
Ogrergo
Gnoblar
Posts: 10
Joined: Wed Apr 04, 2012 11:40 pm

Re: Building v1.8

Post by Ogrergo »

Hi guys,

I also have this problem. Freetype is searched in /usr/X11R6 which is not built for armv7. From the dependencies https://bitbucket.org/cabalistic/ogredeps I managed to build freetype and the other dependencies for armv7 but only if I removed the Cmake Post build scripts, which were complaining about lipo ... architecture (i386) incompatible, or something like that. I couldn't fix it and I removed it, and the build was successful. However, only .a were created, and not .dylib, which is required by Samples_Browser.

I tried to build freetype for armv7 but again - no success. Below is the error log from the attempt of building freetype for armv7:
./configure '--prefix=/usr/local/iphone' '--host=arm-apple-darwin' '--enable-static=yes' '--enable-shared=no' 'CC=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/llvm-gcc-4.2/bin/arm-apple-darwin10-llvm-gcc-4.2' 'CFLAGS=-arch armv7 -pipe -mdynamic-no-pic -std=c99 -Wno-trigraphs -fpascal-strings -O2 -Wreturn-type -Wunused-variable -fmessage-length=0 -fvisibility=hidden -miphoneos-version-min=3.2 -I/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.2.sdk/usr/include/libxml2 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.2.sdk' 'CPP=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/cpp' 'AR=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/ar' 'LDFLAGS=-arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.2.sdk -miphoneos-version-min=3.2'
configure: WARNING: if you wanted to set the --build type, don't use --host.
If a cross compiler is detected then cross compile mode will be used
checking build system type... i386-apple-darwin11.3.0
checking host system type... arm-apple-darwin
checking for arm-apple-darwin-gcc... /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/llvm-gcc-4.2/bin/arm-apple-darwin10-llvm-gcc-4.2
checking whether the C compiler works... no
configure: error: in `/Developer/OgreDependenciesTrunk/ogredeps/src/freetype-2.4.9/builds/unix':
configure: error: C compiler cannot create executables
See `config.log' for more details
make: *** [setup] Error 77
I tryed several compilers with this command, from gcc, gcc-4.2, llvm-gcc-4.2 to arm-apple-darwin10-llvm-gcc-4.2 - nothing works.

What do you guys think ? Did you managed to build and deploy an Ogre app on iPhone by now ? If yes, how did you succeeded ?

Thanks in advance !
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: Building v1.8

Post by masterfalcon »

You have a couple options. 1. We provide prebuilt dependencies that you can use or 2. You build that deps package just like Ogre, configure with CMake and build with Xcode.