开发者

error when include <list> in cocos2d project

开发者 https://www.devze.com 2023-03-06 23:48 出处:网络
i want to include list in cocos2d. the error is : \"the file/directory doesn\'t exist\". i\'ve tried to change my file type(xcode4) to objc++ and objc and even c. but still won\'t work. anyone know ho

i want to include list in cocos2d. the error is : "the file/directory doesn't exist". i've tried to change my file type(xcode4) to objc++ and objc and even c. but still won't work. anyone know how to fix it?

#import <Foundation/Foundation.h>
#import "cocos2d.h"
#include <list>

#define POINT_LIMIT 50
#define USE_LAGRANGE 1

using namespace std;

inline float lagrange2(CGPoint p1, CGPoint p2, CGPoint p3, float x开发者_JAVA百科);
inline float lagrange1(CGPoint p1, CGPoint p2, float x);

inline void CGPointSet(CGPoint *v, float x, float y);
inline void f1(CGPoint p1, CGPoint p2, float d, CGPoint *o1, CGPoint *o2);
inline void f2(CGPoint p1, CGPoint p2, float d, CGPoint *o1, CGPoint *o2);

@interface CCBlade : CCNode {
    list<CGPoint> path;
    unsigned int pointLimit;
    int count;
    CGPoint vertices[2*POINT_LIMIT + 5];
    CGPoint coordinates[2*POINT_LIMIT + 5];
    BOOL reset;
@protected
    CCTexture2D *_texture;  
    float width;
}
@property unsigned int pointLimit;
@property(retain) CCTexture2D *texture;
@property float width;
- (void) push:(CGPoint) v;
- (void) pop;
- (void) clear;
- (void) reset;
- (void) dim:(BOOL) dim;
@end


Strange but true, the solution to fix the compile error is simply to rename any files that #import that header file to have .mm file extension. Please give it a try ;)

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号