Knuth
Knuth

Reputation: 13

Failed to compile cocos2d-2.0-beta with Apple LLVM 3.0 in Xcode 4.2

I following the guide http://www.tinytimgames.com/2011/07/22/cocos2d-and-arc/ to try to include cocos2d with an ARC enabled project, but it cannot pass compile, the error is in ccCArray.h:

/** Sends to each object in arr the message identified by given selector. */
static inline void ccArrayMakeObjectsPerformSelector(ccArray *arr, SEL sel)
{
for( NSUInteger i = 0; i < arr->num; i++)
    #pragma clang diagnostic push
    #pragma clang diagnostic ignored "-Warc-performSelector-leaks"
    [arr->arr[i] performSelector:sel];
    #pragma clang diagnostic pop
}

static inline void ccArrayMakeObjectsPerformSelectorWithObject(ccArray *arr, SEL sel, id object)
{
for( NSUInteger i = 0; i < arr->num; i++)
    #pragma clang diagnostic push
    #pragma clang diagnostic ignored "-Warc-performSelector-leaks"
    [arr->arr[i] performSelector:sel withObject:object];
    #pragma clang diagnostic pop
}

the error "Unknown warning group -Warc-performSelector-leaks", I don't know how the fixed it.

I saw many questino about this problem, but the difference is they got warning while I got error, so I can not even ignore it.

Any help is appreciate! thanks!

Upvotes: 1

Views: 413

Answers (1)

CodeSmile
CodeSmile

Reputation: 64477

You could simply remove the 3 #pragma clang lines and see if that helps.

You may also have enabled "Treat Warnings as Errors" in your target's build settings. That would cause any warning to be treated as an error.

Upvotes: 1

Related Questions