iPhone example app - help?


#1

Hi,
just tried to build the iPhone example project (HelloWorld.xcodeproj), but I got 13 errors, like this one:
Undefined symbols:
"_glGenFramebuffersOES", referenced from:
juce::GLESContext::createGLBuffers() in JuceLibraryCode4.o
"_glDeleteFramebuffersOES", referenced from:
juce::GLESContext::freeGLBuffers() in JuceLibraryCode4.o
"_glGetRenderbufferParameterivOES", referenced from:
juce::GLESContext::createGLBuffers() in JuceLibraryCode4.o
juce::GLESContext::createGLBuffers() in JuceLibraryCode4.o
"_glViewport", referenced from:
juce::juce_glViewport(int, int)in JuceLibraryCode4.o
".objc_class_name_EAGLContext", referenced from:
literal-pointer@__OBJC@__cls_refs@EAGLContext in JuceLibraryCode4.o
"_glBindFramebufferOES", referenced from:
juce::GLESContext::makeActive() const in JuceLibraryCode4.o
juce::GLESContext::createGLBuffers() in JuceLibraryCode4.o
"_glBindRenderbufferOES", referenced from:
juce::GLESContext::swapBuffers() in JuceLibraryCode4.o
juce::GLESContext::createGLBuffers() in JuceLibraryCode4.o
juce::GLESContext::createGLBuffers() in JuceLibraryCode4.o
juce::GLESContext::createGLBuffers() in JuceLibraryCode4.o
"_glGenRenderbuffersOES", referenced from:
juce::GLESContext::createGLBuffers() in JuceLibraryCode4.o
juce::GLESContext::createGLBuffers() in JuceLibraryCode4.o
"_glFramebufferRenderbufferOES", referenced from:
juce::GLESContext::createGLBuffers() in JuceLibraryCode4.o
juce::GLESContext::createGLBuffers() in JuceLibraryCode4.o
".objc_class_name_CAEAGLLayer", referenced from:
literal-pointer@__OBJC@__cls_refs@CAEAGLLayer in JuceLibraryCode4.o
"_glDeleteRenderbuffersOES", referenced from:
juce::GLESContext::freeGLBuffers() in JuceLibraryCode4.o
juce::GLESContext::freeGLBuffers() in JuceLibraryCode4.o
"_glCheckFramebufferStatusOES", referenced from:
juce::GLESContext::createGLBuffers() in JuceLibraryCode4.o
"_glRenderbufferStorageOES", referenced from:
juce::GLESContext::createGLBuffers() in JuceLibraryCode4.o
ld: symbol(s) not found

I have:

  • MacOSX 10.6.3
  • XCode 3.2.1, 64-bit
  • iPhone SDK 3.1.3
  • looks like there is OpenGL 1.6.7 in the frameworks
  • latest JUCE from git

Any thought on what I’m doing wrong here?

PS
I’m an experienced C++ dev. and have lots of experience with Visual Studio on Windows, but I’m new to Mac development…


#2

looks like you are missing the OpenFL framework, you should add it to the used frameworks list in your project, or perhaps disable OpenGL in juce config.


#3

Thanks, that eliminated some errors alright (added OpenGLES.framework).

Now still one left:
".objc_class_name_CAEAGLLayer", referenced from:
literal-pointer@__OBJC@__cls_refs@CAEAGLLayer in JuceLibraryCode4.o
ld: symbol(s) not found
collect2: ld returned 1 exit status

Anyone any idea about that?

Koen


#4

I think that’s part of CoreAnimation.

I’m not sure what framework you need for CoreAnimation on the iPhone, but I have in mind that it used to be QuartzCore. Might still be for all I know. :slight_smile:


#5

Yes, that was it: added QuartzCore.framework and it worked! Great!

Now, next question: can we also use the JUCE audio classes in applications for iPhone?


#6

Just a quick follow-up in case anyone bumps into the same issues as myself (and to help Julian).
After getting the example app to run in the simulator (see above), getting it to run on my iPhone required some additional steps:

  1. first I got the CodeSign error when building the iPhone Device 3.1.2 build

–> you need to setup the necessary code signing stuff, which you can do by following the instructions on the iPhone provisioning portal: http://developer.apple.com/iphone/manage/overview/index.action

Quite some administration, but it does work fine.

  1. after that, no more CodeSign errors, but I got a new build error, something like:

    {standard input}:160216:branch out of range
    Command /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc-4.2 failed with exit code 1

While looking this up, I bounced into this forum post:
http://www.ogre3d.org/forums/viewtopic.php?f=4&t=51151&start=150#p352772
and setting the “Compile for Thumb” setting to “Off” indeed fixed the problem.

Et voilà, this is how I got it to build and then run on my iPhone.


#7

Thanks for posting that! It’s amazing just how hard Apple have made it to simply compile and run an app on your own device.


#8

Hi,

i just followed the same problem using the new (experimental) jucer. basically, if you have it emit the default app and build for iphone you need to add the two extra frameworks mentioned by KoenTanghe. the mac build is fine. the experimental jucer should be adjusted for this at some point.


#9

Cheers Hugh. I had it set to only add QuartzCore and OpenGLES if you’d enabled openGL, but I guess I’ll just add them both by default.