Unknown class type name; did you mean "class"? Auriotouch

I am trying to move code from an AurioTouch project to my project. But I have a lot of errors:

Unknown type name 'class'; did you mean 'Class'? 

For example, in the FFTBufferManager.h file:

 #include <AudioToolbox/AudioToolbox.h> #include <libkern/OSAtomic.h> #include "SpectrumAnalysis.h" class FFTBufferManager { public: FFTBufferManager(UInt32 inNumberFrames); ~FFTBufferManager(); 

I tried changing the compiler to LLVM GCC 4.2, but it gives many other errors:

 Expected '=', ',', ';', 'asm' or '__attribute__' before 'FFTBufferManager' 

What am I doing wrong?

+6
source share
1 answer

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

.mm
The source file with this extension may contain C ++ code in addition to Objective-C and C code. This extension should only be used if you really reference C ++ classes or functions from your Objective-C code.

+8
source

Source: https://habr.com/ru/post/909193/


All Articles