views:

359

answers:

3

Has anyone come across this problem when building with cocos2d (OpenGL library for iPhone 2D games)?

"glui/GL/glui.h" file is not found
gluOrtho2D was not declared
GL_COLOR_BUFFER_BIT was not declared.

There seems to be very little info on GLUI for iPhone on the web. I am new to OpenGL, so appreciate the help! I have included OpenGLES CoreGraphics libraries, even tried adding linker flag "-framework GLUI" but to no avail.

Thanks!

A: 

Are you following along w/the getting started Cocos2d: http://monoclestudios.com/cocos2d_whitepaper.html

Mr-sk
Yes. Except I'm using the latest Cocos2d-0.9.0-beta. I completed up to the part that said: "After you've added the two frameworks, your linked libraries should look like this: ... Now when you build the project, it will actually build." It doesn't seem to have any specific instruction as to GLUI path or framework. What am I missing?
twinkle
BTW I downloaded GLUI Framework.pkg from http://lukecyca.com/2007/02/14/glui-23-framework-for-mac-os-x/, double clicked it to install, then it seems like nothing happens. How does one install this framework?
twinkle
A: 

I solved this problem by

  • removing cocos2d's external/Box2d/Testbed directory
  • adding GLUI.framework from /Library/Frameworks/GLUI.framework (and setting the framework search path)

It compiles successfully, but dies on launching in simulator with this error, which seems unrelated to the question above.

dyld: Symbol not found: _CFXMLNodeGetInfoPtr
Referenced from: /System/Library/Frameworks/Security.framework/Versions/A/Security
Expected in: /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.1.2.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation in /System/Library/Frameworks/Security.framework/Versions/A/Security
twinkle
A: 

I was finally able to get this working by following a different tutorial. The Monocles tutorial is outdated since it uses cocos2d v.0.7.2.

There has been significant change to cocos2d v.0.8, which comes pre-packaged with an easy to use XCode Project Template, and in v.0.9, libraries filenames have been further improved with the CC prefix to avoid namespace collision. I would recommend this tutorial instead:

http://iphonedev.net/2009/07/12/cocos2d-example-box2d/

Also found this to be useful. http://www.mycodestudio.com/blog/2009/12/06/cocos2dpt1/

twinkle