milkytracker / MilkyTracker

An FT2 compatible music tracker
http://milkytracker.github.io/
Other
1.69k stars 162 forks source link

Build issues on Linux: Compilation fails without RTMIDI #207

Closed CorvusCorax closed 4 years ago

CorvusCorax commented 4 years ago

Ubuntu 18.04.4 LTS on master

After following build instructions:

cmake:

-- Could NOT find RTMIDI (missing: RTMIDI_LIBRARY RTMIDI_INCLUDE_DIR) (Required is at least version "2.1.0")
MIDI support disabled (RtMidi unavailable)

make fails in linking stage:

...
[ 99%] Building CXX object src/tracker/CMakeFiles/tracker.dir/sdl/SDL_KeyTranslation.cpp.o
[ 99%] Building CXX object src/tracker/CMakeFiles/tracker.dir/sdl/SDL_Main.cpp.o
[100%] Linking CXX executable milkytracker
../ppui/osinterface/libosinterface.a(PPSystem_POSIX.cpp.o): In function `System::getTempFileName()':
PPSystem_POSIX.cpp:(.text+0x10): warning: the use of `tmpnam' is dangerous, better use `mkstemp'
CMakeFiles/tracker.dir/sdl/SDL_Main.cpp.o: In function `StopMidiRecording()':
SDL_Main.cpp:(.text+0x638): undefined reference to `MidiReceiver::stopRecording()'
CMakeFiles/tracker.dir/sdl/SDL_Main.cpp.o: In function `StartMidiRecording(unsigned int)':
SDL_Main.cpp:(.text+0x670): undefined reference to `MidiReceiver::MidiReceiver(MidiReceiver::MidiEventHandler&)'
SDL_Main.cpp:(.text+0x68b): undefined reference to `MidiReceiver::startRecording(unsigned int)'
CMakeFiles/tracker.dir/sdl/SDL_Main.cpp.o: In function `main':
SDL_Main.cpp:(.text+0x24ed): undefined reference to `MidiReceiver::~MidiReceiver()'
collect2: error: ld returned 1 exit status
src/tracker/CMakeFiles/tracker.dir/build.make:2299: recipe for target 'src/tracker/milkytracker' failed
make[2]: *** [src/tracker/milkytracker] Error 1
CMakeFiles/Makefile2:402: recipe for target 'src/tracker/CMakeFiles/tracker.dir/all' failed
make[1]: *** [src/tracker/CMakeFiles/tracker.dir/all] Error 2
Makefile:151: recipe for target 'all' failed
make: *** [all] Error 2

Installing package librtmidi-dev fixes this:

Suggested fix:

  1. Add stub functions to allow compilation without midi or
  2. Add package "librtmidi-dev" as a system compilation requirement in Install.md
dwhinham commented 4 years ago

Add package "librtmidi-dev" as a system compilation requirement in Install.md

We already say this. We don't specifically say librtmidi-dev because that's a Debian/Ubuntu-ism, but yeah:

To build the SDL port of MilkyTracker you will need the following development libraries installed on your system: ... RtMidi (for Linux MIDI support)

Still, we could #ifdef out the MIDI stuff so that it's not a hard requirement. I'll take a look shortly.

(Shouldn't you be enjoying Revision? 😄 )

CorvusCorax commented 4 years ago

"Shouldn't you be enjoying Revision?"

That kinda went over my head. Checks IMDB for a movie with that title

dwhinham commented 4 years ago

https://2020.revision-party.net/start https://www.twitch.tv/revisionparty

CorvusCorax commented 4 years ago

+++ !! :-)

dwhinham commented 4 years ago

Fixed.