you’re NEARLY there…
you started with
MidiOutput* midioutdevice;
midioutdevice = new MidiOutput(); //This is not working!
which doesn’t work because you can’t just create a new MidiOutput using the constructor - you have to use the openDevice function which will return a pointer to an open device. Then you tried…
MidiOutput midiOutput;
midiOutput = MidiOutput::openDevice(0);
Which is so close, but notice what you’ve done wrong… openDevice returns a pointer to a MidiOutput, but your variable midiOutput is not a pointer. Not only does this mean that you can’t store the result of openDevice to it, but when you say “MidiOutput midiOutput;”, it’s giving you the same problem as saying “MidiOutput *midiOutput = new MidiOutput()” - the constructor cannot be used to create a new instance.
So you want it to be…
MidiOutput midiOutput;
midiOutput = MidiOutput::openDevice(0);
Then, assuming your returned device is valid, you can call stuff from it using the pointer ‘arrow’ operator.
e.g.
midiOutput->sendMessageNow (MidiMessage::noteOn(1,50,1.0f));