The topic says it all... I cannot for the life of me figure out how to split my code into multiple .h/.c files...
For the most part my code is all self contained only relying on the Midi.h class. In order to make use of midi input, you have to subclass the Midi class. This works perfectly when all in one file with the appropriate #include <Midi.h>
However, when I try to move my subclass into its own two files mymidi.c/h I am getting various odd errors when I try to compile.. Such as:
/mymidi.h:13: undefined reference to `vtable for MyMidi' (note: this happens only when the class in mymidi.c is COMMENTED OUT, as in no actual code, just the header)
The following error happens when the class in mymidi.c IS NOT commented out... There's a few pages of these types of errors.
C:\Program Files\Arduino\hardware\arduino\cores\arduino/WString.h:28: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'String'
C:\Program Files\Arduino\hardware\arduino\cores\arduino/WString.h:99: error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token
C:\Program Files\Arduino\hardware\arduino\cores\arduino/WString.h:106: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'operator'
How can it be this awkward? Granted I come from a PHP background, where it is as simple as an include() and bang! the included file is inserted inline... Don't get me started about the IDE's seriously weird handling of multiple .pde files... Concatenate them alphabetically?!? That just doesn't make sense to me whatsoever...
Any help would be wonderful ![]()