I created a new box2d project using 0.99.5 beta 3 and imported my project files for my game. Afterword it built fine. I made a few mediocre changes, and afterword I got 33,000+ errors, errors in files like CFDictionary. I closed the file, cleaned the project, and rebuilt and then got 67,000 errors. I don't know what is wrong but I am getting extremely frustrated. It was fine before. What could be wrong?
Problem with 0.99.5 beta 3?
(34 posts) (12 voices)-
Posted 1 year ago #
-
Could you post a few examples of the errors that it's producing?
Posted 1 year ago # -
Yeah it does. And then I add my game's files and then it compiles then as well. But then I make any modification in any file and I get all those errors. Errors like "...Does not respond to..." or "missing ;" when there is a semicolon. It happens in a number of files, none of them mine. Or cocos2d's. Files like CFDictionary. So I don't know if it is a problem with cocos2d but I can do this with any other template just not the box2d template.
Posted 1 year ago # -
I did some more testing and this is what is going on -
I have both the 4.2 SDK and the 4.1 SDK installed. I created the project under the 4.2 SDK, and when I open it in the 4.1 SDK, that is when I get the errors. But if I build it using the 4.2 SDK I have no issues. Now I am convinced that this is not a problem with 0.99.5b3. Does anyone have an idea for a solution?
Posted 1 year ago # -
Now it is happening when I don't even change sdk's. I modified two lines of game code, rebuilt - and I have the errors. I had recreated a new project and it built fine, imported my files again, built, ran, modified two lines, built and a whooping 75,000 errors. Ideas?
Posted 1 year ago # -
When you launch it, are you opening from the .xcodeproj file, or are you explicitly opening XCode with 4.1 SDK first, and then the project?
Just thinking the file associations might be pointing to the new XCode version and confusing it. Another possibility is that there's some 4.2-specific bits hiding behind the scenes in your project files that are getting it snarled.
To clear this up, I'd suggest uninstalling the beta version, and rebuild your project from a fresh template using the current XCode with 4.1.
Good luck!
Posted 1 year ago # -
All right - here I go . . .
I started off by uninstalling all of the SDK's that I had installed, and then reinstalled iOS 4.1 SDK. Upon Xcode launch, I would get a XCSpecification internal error. So I went the above and beyond, and reinstalled the entire OS. Brand Spanking NEW Install. Then, I installed iOS SDK 4.1, ONLY, installed the cocos2d templates, copied all my project files over (most all being c++ models), and built. AGAIN I am getting more than 75,000 errors. I am at a loss. I have half a mind to abandon cocos2d all together. I just don't know what to do. Ideas?
Posted 1 year ago # -
Just tried it with 0.99.4 and it works fine - maybe it does have to do with 0.99.5beta3?
Posted 1 year ago # -
Nope. All I did was close the project using 0.99.4 and opened it again and now I am getting those 75,000 errors again. Ideas?
Posted 1 year ago # -
Ben,
A couple of suggestions:
1) Is it possible to ad just some of your code instead of all of it and see hoe it goes?
For example... Start with a clean cocos2d template and add just any utility classes first (code that usually doesn't make calls to other stuff besides itself).
If that goes well, then slowly integrate your AppDelegate changes into the new AppDelegate (perhaps temporarily commenting out some lines to keep it simple and not drag in too much of your code..ie main program, etc)...
If that goes well then add your menus only and see (and comment out the actual calls to you games main logic).
I think you get where I am going with this. Anyway, the thing is that if you can find where the errors begin to start, it would give you (and others here trying to help) a more exact idea by simplify the differences between all code works, and then all code doesn't work.
Also, in each step above, make sure to shutdown XCode and restart since your last post made mention that caused the errors to begin again.
2) Since your seeing sporadic and temporary success followed by failure again it certainly could be possible that your upgrade processes caused some issues internally in your build/Xcode/system files/etc. So if possible you may want to record your changes you've made (or tag them in your version control) and use Time Machine to go back to the last stable version of your system.
I know both suggestions sound like alot of work, but it sounds like this has been grinding on for you for quite some time, so it may actually be quicker to drop back (ala time machine) than trying to fix something that may be out of your control (if it is in fact a corrupted upgrade situation.). My suggestion is to try suggestion (1) for a day or two, and if it does not seem to be yielding any results then just bite the bullet and do the whole time-machine thing. (Of course, it goes without saying that you might want to backup to some other media before attempting your time-machine restore just in case something goes wrong).
Hope this helps,
QUPDATE:
Ben, I just noticed i another post that you started experiencing these issues after trying to integrate GIT. So I would suggest dropping back to pre-git version of your system. I am not slamming git here, I hear it is a great tool, but since your issues seem to have started with that installation, I would jump back before it just to have peace of mind).Posted 1 year ago # -
Like I said, I just barely, in spite of the errors, reinstalled the entire OS to a clean install then installed the 4.1 sdk only. No git has been installed. I started a new project and imported all my project files (most of them being CPP files for my C++ model). And yes, in any file that uses them I have renamed it to have a .mm extension. The errors lie in the Apple-provided frameworks as well as the font label class. I am at a loss.
Posted 1 year ago # -
Ben,
Sorry I missed that you had re-installed the OS, etc.
BTW, I just saw that someone else had seen some errors (though nothing like the amount you are seeing) after an upgrade...as it turned out they had a duplicate CCConfiguration file in their project.
It's a long shot, but thought it might be worth a quick look...here's a link to the thread: http://www.cocos2d-iphone.org/forum/topic/10435
Posted 1 year ago # -
Well, I enjoyed 1 day of error-free coding. Then yesterday, I hit build and it worked just fine. I left my computer, and when I came back to it I hit build again. I got 15 DUPLICATE_ERROR errors so I hit clean. When I hit build again, I got 75,000 errors. Again. Now that I look back, I realize that maybe even every time I get the errors, it is after I clean the build. Suggestions?
Posted 1 year ago # -
Any ideas?
Posted 1 year ago # -
I was experience something that sounds similar when trying to get cocos2d working with the shared library approach. I'd upgraded to the latest xcode but not 4.2.
I found that in my old projects i'd get the base sdk missing error so would have to get info on the project and change that back to 3.2 and they'd compile
for the shared libraries however i discovered that if i set up a new project under 4.1 with 99.4 as a shared library i would get 600 odd errors when compiling a bare bones framework (basically the hello world and the shared 99.4 library). If i shift back to 4.0 then i could get it to compile okay.
I've not been able to do any work on the project to know whether this was a fix. But it sounds like there is something similar going on here with SDK versions and Xcode/cocos2d
Whilst not an answer perhaps experimenting with compiling under different SDK versions might help you?
cheers, paul
Posted 1 year ago # -
I only have the one SDK version. So I can't just switch between the different SDK versions.
Anyway, CONFIRMED: I have done this multiple times to be sure -
When I start a new project with the template, it builds fine. I add my project files over, and it builds fine. But when I clean the build, that is when I get the errors - upon building again after I cleaned it. I need to clean it because I am changing the default.png file.Any ideas as to why this is happening?
ThanksPosted 1 year ago # -
It appears I am suddenly in the same boat. Being that the last post was a month ago I assume Ben either figured it out or abandoned Cocos2d. If anyone has figured it out I would appreciate the hearing the answer.
This issue began for me when I updated my iPad (the only device I am currently working with) to IOS 4.2, after which I realized I had to update xCode as well in order to update my app on the device. I was using Cocos2d version 0.99.4, and when the thousands of errors appeared I assumed I just needed to update my version of Cocos2d to go along with the new Os and such (i dunno why I thought that really, but that's what I did).
In my case it is 39000 errors, all but a few of which are in Apple framework. There are a few in some of my files and I haven't figured out why yet. They are all in relation to NSMutableArray in my base classes that derive from NSObjects (or CCSprites), but the NSMutableArrays in my other classes deriving from those base classes to not throw errors.
I get similar results upon cleaning to Bens, and I can create a hello world for both plain Cocos2d app and Cocos2d/Box2d (haven't tried Chipmunk) which compiles and runs.
I have recently acquired a Macbook, and was previously programming on a macMini, the Mini can be used to run any sort of test ideas that someone might suggest to figure this mess out. I am about out of time for the moment, I will be looking into this around Apple dev site when I can, it seems to be more of their problem really.
I plan to start working on a new game that I was going to start soon anyway, so as to see when or if the errors begin in the natural flow of things, and tonight I might try cut/pasting some code in from my game to a hello world to see what happens.
My game is almost finished!!!!!?!?! Gahhhhhh!!
Thanks if you can help me.
Posted 1 year ago # -
Any chance you can post the _first_ error in the list? It sounds like there's something wrong before an #import which is throwing the parser out, so it's failing to process everything after that.
If you're willing, you could post a full copy of a project with the problem, and see if it happens to other people. That'll determine if it's the project, or the Xcode/iOS SDK installation that's the issue here.
Posted 1 year ago # -
Picture worth a thousand words, if I linked it right.

Haven't had time to try much yet but I did copy my base classes into a blank project with no trouble yet upon clean/rebuild all. These are the only ones within my code that were throwing errors. Also realized that the GLES-Render.h has one line that is erroring, on the class definition on line 39 (relation to box2d?). My earlier post was a little more hasty than I would have liked, I overlooked that in my base classes there are also errors in relation to box2d objects, of the same nature as the NSMutable array ones.
error: expected specifier-qualifier-list before 'NSMutableArray'
As for your guess about throwing the parser out I think you are right, it's just a matter of finding a needle in a haystack.
Tomorrow is the one day a week I am typically uninterrupted for a few hours, my plan is similar to Questors suggestion #1 (breaking the haystack up into small piles), which I have somewhat already started.
As far as posting a project with the problem, we will have to see if that is necessary based on what tomorrow brings.
Thank you for your time.
Posted 1 year ago # -
OK, so I am going through adding my files a .h and .mm pair at a time, clean all, build, restart xCode, build. Monkeywork and time consuming, I got bored and recompiled the screwed up project and noticed it has only 89 source files in the precompiled part while the working one has 132.
This is probably what I need to fix but I don't know how, I compared the project settings via Project->Edit Project Settings and couldn't find any differences outside of project name. If I remember right there was some other way to mess with project settings-ish stuff that I used once when I was starting out a few months ago, but I can't seem to find it.My other guess is that it is a naming conflict between one of my class files and something somewhere in the mountain of code my code is piled on.
Posted 1 year ago # -
The culprit was a class named Block, and the file Blick.h, bad naming choice on my part I guess, but that's water under the bridge now.
Apparently Apple is using that name now, though I couldn't find it as a class, just as
#define Block_copy(...)
in a file called Block.h (just as mine was). It says block.h is from 2008, but i never had these errors before.
I don't really understand the workings of the compiler well enough to know why this error doesn't point a little more directly to the file name conflict, but it would sure be nice if it did.
I must admit to being a more than a little irritated with Ben Kraus here. I see he has had activity in the forums since this post, which makes me assume he did not abandon Cocos2d and has figured out the answer. After receiving help and ideas from multiple users he failed to follow up as to what the fix was.
Then again perhaps he abandoned the project as a whole and never knew what happened?
If not I say, Bad Form sir.
Posted 1 year ago # -
Was this a C++ Block class, or an Objective-C Block class? If Apple are using the name (and I can't find any reference to it) I'd be surprised. Particularly because blocks is a C language extension and hence would be "block" as a type, I think.
Posted 1 year ago # -
Here's the path to the file if you want to look at it,
Developer->Platforms->iPhoneOs.platform->Developer->SDKs->iPhoneOs4.2.sdk->usr->include
or you can type "Block" into Xcode and jump to definition.
I guess it is a C header, and was there before which makes me wonder why I never had this error before. I assumed it was something Apple had changed since the errors began upon updating Xcode and iOS.
Posted 1 year ago # -
Ohhh, I see. It's the file named Block.h that's the problem, not a class named Block? Sorry, I misunderstood your earlier post.
Posted 1 year ago # -
It wasn't a very clear post on my part, I wasn't really sure yet exactly what part of Block was causing the problem and was just excited to have my project back alive. Thanks again for your interest and help.
Posted 1 year ago # -
Thank you for this thread!!!!!! I was about to pull my hair out. I had a class named Block as well, and had the exact same problem. It's just insane that this name breaks the build.
Posted 1 year ago # -
Prefixes. ;d
http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/CodingGuidelines/Articles/NamingBasics.html%23//apple_ref/doc/uid/20001281-BBCHBFAH
Posted 1 year ago # -
but apparently don't follow their own rules.
I don't follow. Apple uses UI, NS, IB, and so on.
Posted 1 year ago #
Reply »
You must log in to post.