c++visual-studiovisual-c++midi

How to compile RtMidi API properly on Windows


I’m using C++ on visual studio 2019 and having issues trying to link my project to PortAudio. When I use the RtAudio header file in a project, I get the error message "MidiInDummy: This class provides no functionality." Most solutions I can find online say to add __WINDOWS_MM__ to the pre-processor definitions and link to winmm.lib (as instructed on https://www.music.mcgill.ca/~gary/rtmidi/) However, having done this, I am still getting the same problem.


Solution

  • I get the error message "MidiInDummy: This class provides no functionality."

    This warns that no valid MIDI API was defined. The warning is issued from the constructor of the MidiInDummy class in rtMidi.cpp, which is just a placeholder without functional implementation.

    add __WIN_MM__ to the pre-processor definitions

    That is the wrong #define for the Windows build, which explains the MidiInDummy warning. The correct definition, listed on the reference page under Compiling is:

    #define __WINDOWS_MM__
    

    Once __WINDOWS_MM__ is defined, the sample cMidiIn.dsp project builds fine with VS 2019 after fixing a few remaining minor issues: