0

So I tried to import aurioTouch into my app and I keep getting this error saying

"unknown type name 'class' did you mean "Class"?

My bridging header file:

#import "AudioController.h"
#import "BufferManager.h"
#import "FFTHelper.h"
#import "DCRejectionFilter.h"

I tried changing this to .mm for all these files but it doesn't solve my issue. Anyone have any ideas why this is happening?

Bowen Su
  • 1,219
  • 3
  • 13
  • 15
  • go to `Breakpoint` tab on the left side. Then click the `+` button, `Add Exception BreakPoint`, run the project, it will locate in the code line where caused this error. and post it here, so we can help you – ronan Aug 08 '15 at 02:51

2 Answers2

1

To mix C++ and Objective-C you need to use the .mm extension. If, however, your class is only C++ (and only includes C/C++ headers) then you can use the normal .cpp extension.

.mm A source file with this extension can contain C++ code in addition to Objective-C and C code. This extension should be used only if you actually refer to C++ classes or features from your Objective-C code.

Rohit suvagiya
  • 1,005
  • 2
  • 12
  • 40
0

I had the same issue, and I could solve by the following answer: Import aurioTouch Library with Swift

In short, AudioController.h is not an Obj-C file because it imports C++ files (BufferManager.h, FFTHelper.h, and DCRejectionFilter.h). So you cannot bridge it to Swift just like that.

You have to create a pure Obj-C file wrapping AudioController.h.

Community
  • 1
  • 1