私は、このヘッダファイル記述しようとしています:Cocoa Touch(Objective-C cross C++)の前方宣言/ #importを正しく処理する方法は?
//@class AQPlayer;
//#import "AQPlayer.h"
@interface AQ_PWN_iPhoneViewController : UIViewController {
AQPlayer* player;
}
@end
AQPlayerはC++で書かれた.mmファイルです。
私はここに、クラス前方宣言を作ってみましたが、それは私に文句:
error: cannot find interface declaration for 'AQPlayer'
だから私は、代わりに「の#import」にヘッダファイルを試してみましたが、それは完全にオフと奇妙な何かを不平を言います。ここでは、エラーのスライスを訴えています:ファイルで
は
/Users/akaraphan/Desktop/SpecialTopic1/AQ_PWN_iPhone/Classes/AQPlayer.h:51,
from /Users/akaraphan/Desktop/SpecialTopic1/AQ_PWN_iPhone/Classes/AQ_PWN_iPhoneViewController.h:12,
from /Users/akaraphan/Desktop/SpecialTopic1/AQ_PWN_iPhone/Classes/AQ_PWN_iPhoneAppDelegate.m:10:
/Developer/Examples/CoreAudio/PublicUtility/CAStreamBasicDescription.h:78: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'CAStreamBasicDescription'
/Developer/Examples/CoreAudio/PublicUtility/CAStreamBasicDescription.h:230: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
/Developer/Examples/CoreAudio/PublicUtility/CAStreamBasicDescription.h:231: error: expected '=', ',', ';', 'asm' or '__attribute__' before '==' token
/Developer/Examples/CoreAudio/PublicUtility/CAStreamBasicDescription.h:233: error: expected '=', ',', ';', 'asm' or '__attribute__' before '!=' token
/Developer/Examples/CoreAudio/PublicUtility/CAStreamBasicDescription.h:234: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<=' token
/Developer/Examples/CoreAudio/PublicUtility/CAStreamBasicDescription.h:235: error: expected '=', ',', ';', 'asm' or '__attribute__' before '>=' token
/Developer/Examples/CoreAudio/PublicUtility/CAStreamBasicDescription.h:236: error: expected '=', ',', ';', 'asm' or '__attribute__' before '>' token
/Developer/Examples/CoreAudio/PublicUtility/CAStreamBasicDescription.h:239: error: expected ';', ',' or ')' before '&' token
から含ま私は何かが足りないのですか?これについて前向きに宣言することはできませんか?
元の質問を回答として投稿するのではなく、編集する必要があります。 これは、AQPlayerとしてobj-cまたはC++クラスですか?'@class AQPlayer;を与えた前方宣言はObj-Cですが、あなたのメソッド呼び出し' player-> StartQueue(false); 'はC++の構文です。 C++では 'class AQPlayer;'、Obj-Cでは '[player startQueue:NO];が必要です。 –