谁能告诉我如何在 iOS 5.x -> Objective-C++ 中定义和使用BinaryWriter和BinaryReader(来自 GitHub 上的 OpenFrameworks 项目)C++ 类?
我所做的:
AppDelegate.h
#import <UIKit/UIKit.h>
#import "Poco/BinaryWriter.h"
@interface AppDelegate : UIResponder <UIApplicationDelegate>{
Poco::BinaryWriter *_myBinaryWriter;
}
@property (strong, nonatomic) UIWindow *window;
@end
AppDelegate.mm
#import "AppDelegate.h"
@implementation AppDelegate
@synthesize window = _window;
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
_myBinaryWriter = new Poco::BinaryWriter(NULL, NULL);
[self.window makeKeyAndVisible];
return YES;
}
@end
但在 mm 文件中我有编译错误:
'Poco::BinaryWriter' 的初始化没有匹配的构造函数
什么是错的,怎么办?
在项目设置中配置了 OpenFrameworks 标头的 ps 路径,链接器可以看到 Poco 类。
谢谢。