我想在cocos2d中包含列表。错误是:“文件/目录不存在”。我试图将我的文件类型(xcode4)更改为objc ++和objc甚至c。但仍然行不通。谁知道怎么修它?
#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);
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
答案 0 :(得分:0)
奇怪但是事实,修复编译错误的解决方案只是重命名#import
该头文件具有.mm
文件扩展名的任何文件。请试一试;)