C errors - Cannot combine with previous 'struct' declaration specifier && Redefinition of 'MyMIDINotifyProc' as different kind of symbol
Posted
by
user1905634
on Stack Overflow
See other posts from Stack Overflow
or by user1905634
Published on 2012-12-15T04:34:13Z
Indexed on
2012/12/15
5:04 UTC
Read the original article
Hit count: 223
I'm still new to C but trying to understand it better by working my way through a small MIDI audio unit (in Xcode 4.3.3). I've been searching for an answer to this all day and still don't even understand exactly what the problem is. Here's the code in question:
//MyMIDINotifyProc.h
#ifndef MIDIInstrumentUnit_CallbackProcs_h
#define MIDIInstrumentUnit_CallbackProcs_h
void MyMIDINotifyProc (const MIDINotification *message, void *refCon);
#endif
//MyMIDINotifyProc.c
#include <CoreMIDI/CoreMIDI.h>
#include "MyMIDINotifyProc.h"
void MyMIDINotifyProc (const MIDINotification *message, void *refCon) {
//manage notification
}
In the header definition I get this:
! Cannot combine with previous 'struct' declaration specifier
I've made sure the definitions match and tried renaming them and I still get this in my .c file:
! Redefinition of 'MyMIDINotifyProc' as different kind of symbol
Which points to the .h definition as the 'Previous definition'.
I know that MIDIServices.h in the CoreMIDI framework defines:
typedef void
(*MIDINotifyProc)(const MIDINotification *message, void *refCon);
But I don't understand if/why that would cause an error. I would be grateful if anyone could offer some help.
© Stack Overflow or respective owner