Search code examples
c++visual-studio-2019

Installing RtMidi.h in Visual Studio 2019


So, i am using Visual Studio 2019 on Windows 10 and i need to install RtMidi.h Library to my C++ project. And i never had experience doing so. All of the tutorials say that there are supposed to be "Include" and "Lib" folders in Library folder, but the only place where you can download it, which is https://github.com/thestk/rtmidi, has no such folders at all! So, how do i properly install this library into my C++ project?

I tried pasting main folder as an "Include" and "Lib" folders, it makes the compiler see the library, even it's objects and methods, but creating object of a class of this library causes a crash, LNK2019, which i guess means that the library was not properly installed.


Solution

  • Open terminal:

    1. CD to folder rtmidi-master

    2. Then input cmd: cmake -G "MinGW Makefiles"

    3. mingw32-make install

    4. Check the cmd output:

    Install the project...

    -- Install configuration: "Debug"

    -- Installing: C:/Program Files (x86)/RtMidi/lib/rtmidi.lib

    -- Installing: C:/Program Files (x86)/RtMidi/bin/rtmidi.dll

    -- Installing: C:/Program Files (x86)/RtMidi/include/rtmidi/RtMidi.h