我想实现我的Xcode项目中C++类,但我发现了以下错误:Xcode中:C++错误:未知类型名称“类”做你的意思是“类”
Expected ';' after top level declarator
Unknown type name 'class'; did you mean 'Class'
#ifndef DoingSomething_hpp
#define DoingSomething_hpp
#include <stdio.h>
class DoingSomething {
public:
static DoingSomething *instance();
int doSomething();
};
#endif /* DoingSomething_hpp */
但添加DoingSomething.hpp到我的viewController后,错误开始显示:
#import "ViewController.h"
#import "DoingSomething.hpp"
@interface ViewController()
任何人都知道为什么这个错误,或者我该如何解决或者如果有解决方法?
我真的很感谢你的帮助。
您的视图控制器是一个Objective-C++文件吗? – dan
@dan,我的viewController是Objective-C文件 – user2924482