Using Apple’s SpeakHere demo as starting point, I want to implement a sound waveform instead of a level meter. I added another view, SoundWaveView, an ObjC class, alongside the GLLevelMeter, and modelled its implementation on the AQLevelMeter.mm class.
After finding that the file should be named “.mm”, the code compiles, but when executing, it crashes with EXC_BAD_ACCESS on the MeterTable object. Printing this object in the debugger gives the following:
error: instance method 'setMeterTable:' has a different number of parameters in different translation units (0 vs. 1)
error: instance method 'setMeterTable:' has a different number of parameters in different translation units (0 vs. 1)
note: instance method 'setMeterTable:' also declared here
note: instance method 'setMeterTable:' also declared here
error: 2 errors parsing expression
Now I suspect that including the MeterTable.h in both AQLevelMeter.mm (Apple) and SoundWaveView.mm (mine) gives me the duplication, but how can I access MeterTable from my class without importing the .h??
Be sure to initialize all the nasty pointer stuff. Or choose another language for less worries (sorry, I couldn’t resist).