【发布时间】:2012-06-06 08:07:43
【问题描述】:
谁能告诉我如何在 iOS 5.x -> Objective-C++ 中定义和使用BinaryWriter 和BinaryReader (from OpenFrameworks project on GitHub) 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 的 Headers 路径在项目设置中配置,链接器可以看到 Poco 类。
谢谢。
【问题讨论】:
标签: c++ objective-c ios poco-libraries