joshnishikawa / MIDIcontroller

A library for creating Teensy MIDI controllers with support for hold or latch buttons, potentiometers, encoders, capacitive sensors, Piezo transducers and other velocity sensitive inputs with aftertouch.
223 stars 19 forks source link

Undefined reference to MIDIchannel #20

Closed jobbojobson closed 2 years ago

jobbojobson commented 2 years ago

I'm not sure if I'm doing something wrong and this could absolutely be down to IDE setup or my knowledge of C, but I've created basically the exact same code as the "MIDIpot" example and I'm getting "undefined reference to MIDIchannel"

image

it obviously knows that MIDIcontroller.h references MIDIpot.h, otherwise I think I'd get worse errors. And anyway, it's there, on line 11 of MIDIpot.h: extern byte MIDIchannel;

What could be happening here?

jobbojobson commented 2 years ago

Sorry my fault.. I had to change my code const byte CHANNEL = 1 to byte MIDIchannel = 1

i.e. I had to know the name of one of the variables within the library.. which is weird.. is this normal for C?

What if there are more variables that I have to assign and then have to go find the name of them..? seems weird to me but I'm a Java dev and have only dabbled with C/C++