Objective-C调用C++文件

“Receiver type for instance messages is a forward declaration”的错误。即使将"@class Hello;" 改为#import "Hello.h"也还是会在NewHello上报"Unkwon type class,did you mean Class" 的错误。

解决方法是:

The solution is to add

 #import "Hello.h" 

to your ViewController.m file and change the file type of ViewController.m to Obj-C++ (from the right panel)

折腾半天的问题到此终于解决。

Objective-C调用C++文件

相关推荐