I'm trying to move code from the AurioTouch project to my project. But I have many errors:
Unknown type name 'class'; did you mean 'Class'?
For example, in file FFTBufferManager.h:
#include <AudioToolbox/AudioToolbox.h>
#include <libkern/OSAtomic.h>
#include "SpectrumAnalysis.h"
class FFTBufferManager
{
public:
FFTBufferManager(UInt32 inNumberFrames);
~FFTBufferManager();
I tried to change the compiler to LLVM GCC 4.2, but it gives a lot of other errors:
Expected '=', ',', ';', 'asm' or '__attribute__' before 'FFTBufferManager'
What am I doing wrong?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With