0

b2Vec2 と整数を含めたいクラスがあります。「b2Vec2」の前にspecifier-qualifier-listが必要であるというエラーが表示され続けます。私はこれを理解することはできません。助けてください。

@interface mTouch : NSObject {

  b2Vec2 touchPoint;
  int cannonNumber;
}

-(void)setTouchPoint:(b2Vec2)tp;
-(void)setCannonNumber:(int)cn;
-(b2Vec2)touchPoint;
-(int)cannonNumber;

@end


@implementation mTouch

-(id)init {
  touchPoint = b2Vec2(0, 0);
  cannonNumber = 0;
}

-(void)setTouchPoint:(b2Vec2)tp{
  touchPoint = tp;
}

-(void)setCannonNumber:(int)cn{
  cannonNumber = cn;
}

-(b2Vec2)touchPoint{
  return touchPoint;
}

-(int)cannonNumber{
  return cannonNumber;
}



@end
4

1 に答える 1

2

box2d をインクルードし、このヘッダーの実装の拡張子が .m ではなく .mm であることを確認します (C++ をサポートするため)。

于 2011-09-22T04:44:00.377 に答える