Domanda

I had been working on a cocos2d-x project for the QNX platform and I am now moving to the iPhone platform to finish developing. I copied all the files over and created a new Xcode4 project and then imported them, but when I go to compile it, I get 40-something errors in the NSObjCRuntime.h. Then it says: Too many errors emitted, stopping now. Some of the errors read: Unknown type name 'NSString'; did you mean 'CCString'? Use of undeclared identifier 'NSString'; did you mean 'CCString'? Use of undeclared identifier 'Protocol' Use of undeclared identifier 'format'; did you mean 'normal'? Use of undeclared identifier 'namestr'

I looked at my Prefix.pch file, after research this seemed to be part of the problem, but everything is wrapped in the #ifdef OBJC ... #endif condition so I don't think that's the issue. I even tried commenting out the code there and still it gave me the same errors.

How can I fix this?

Thanks!

EDIT: This actually seems to be a problem with the OpenGLES library. When it's not included and I comment out all gl calls, the errors go away. Any thoughts? I used this code to load the OpenGLES Library:

#import <OpenGLES/EAGL.h>
È stato utile?

Soluzione

I figured it out! It was because in Cocos2d-x 2.0 they've changed a lot of the drawing functions from version 1. It's no longer like regular OpenGLES, you have to use their built in methods to set up OpenGLES.

See this link: Migrate to v2.0

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top