I want to use SimpleAudioEngine for the music in a cocos2d game I'm working on. When I import SimpleAudioEngine.h in my game layer I get syntax errors in CVPixelBuffer.h and CMFormatDescription.h.
I've created a new clean cocos2d application and imported SimpleAudioEngine and it worked just fine, thus the error is in the code of my application.
What do you think causes the errors with SimpleAudioEngine? How can I fix this?
EDIT:
Looks like the problem is with size_t width
when creating CVPixelBuffer.
In this code:
CV_EXPORT CVReturn CVPixelBufferCreate(CFAllocatorRef allocator,
size_t width,
size_t height,
OSType pixelFormatType,
CFDictionaryRef pixelBufferAttributes,
CVPixelBufferRef *pixelBufferOut) __OSX_AVAILABLE_STARTING(__MAC_10_4,__IPHONE_4_0);
It raises error for size_t width
and saying:
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVPixelBuffer.h:183: error: expected ';', ',' or ')' before numeric constant
Do you have You have the CoreFoundation framework linked to your project? How about
#import <CoreFoundation/CoreFoundation.h>
? My guess is it can't find theCFAllocatorRef
symbol.