milkytracker / MilkyTracker

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

Incompatible with rtmidi 5.0.0 #262

Closed dvzrv closed 1 year ago

dvzrv commented 2 years ago

Hi! I'm packaging rtmidi for Arch Linux and am currently attempting a rebuild of all depending packages (due to a soname change).

It appears, that rtmidi switched to C++11, which is incompatible with milkytracker, as it relies on C++98.

[55/216] Building CXX object src/midi/CMakeFiles/midi.dir/posix/MidiReceiver_pthread.cpp.o
FAILED: src/midi/CMakeFiles/midi.dir/posix/MidiReceiver_pthread.cpp.o
/usr/bin/c++ -DMILKYTRACKER -I/build/milkytracker/src/MilkyTracker-1.03.00/src/midi -I/build/milkytracker/src/MilkyTracker-1.03.00/src/midi/../milkyplay -I/build/milkytracker/src/MilkyTracker-1.03.00/src/midi/../ppui -I/build/milkytracker/src/MilkyTracker-1.03.00/src/midi/../ppui/osinterface -I/build/milkytracker/src/
MilkyTracker-1.03.00/src/midi/../tracker -I/build/milkytracker/src/MilkyTracker-1.03.00/src/midi/../ppui/osinterface/posix -I/usr/include/rtmidi -D_FORTIFY_SOURCE=2 -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -std=c++98 -MD -MT src/midi/CMakeFiles/midi.dir/posix/MidiReceiver_pthread.cpp.o -MF src/midi/CMakeFiles/m
idi.dir/posix/MidiReceiver_pthread.cpp.o.d -o src/midi/CMakeFiles/midi.dir/posix/MidiReceiver_pthread.cpp.o -c /build/milkytracker/src/MilkyTracker-1.03.00/src/midi/posix/MidiReceiver_pthread.cpp
In file included from /build/milkytracker/src/MilkyTracker-1.03.00/src/midi/posix/MidiReceiver_pthread.cpp:34:
/usr/include/rtmidi/RtMidi.h:137:19: error: expected ‘,’ or ‘...’ before ‘&&’ token
  137 |      RtMidi(RtMidi&& other) noexcept;
      |                   ^~
/usr/include/rtmidi/RtMidi.h:137:6: error: invalid constructor; you probably meant ‘RtMidi (const RtMidi&)’
  137 |      RtMidi(RtMidi&& other) noexcept;
      |      ^~~~~~
/usr/include/rtmidi/RtMidi.h:137:27: error: expected ‘;’ at end of member declaration
  137 |      RtMidi(RtMidi&& other) noexcept;
      |                           ^
      |                            ;
/usr/include/rtmidi/RtMidi.h:137:29: error: ‘noexcept’ does not name a type
  137 |      RtMidi(RtMidi&& other) noexcept;
      |                             ^~~~~~~~
/usr/include/rtmidi/RtMidi.h:137:29: note: C++11 ‘noexcept’ only available with ‘-std=c++11’ or ‘-std=gnu++11’
/usr/include/rtmidi/RtMidi.h:222:27: warning: defaulted and deleted functions only available with ‘-std=c++11’ or ‘-std=gnu++11’
  222 |   RtMidi(RtMidi& other) = delete;
      |                           ^~~~~~
/usr/include/rtmidi/RtMidi.h:223:38: warning: defaulted and deleted functions only available with ‘-std=c++11’ or ‘-std=gnu++11’
  223 |   RtMidi& operator=(RtMidi& other) = delete;
      |                                      ^~~~~~
/usr/include/rtmidi/RtMidi.h:284:20: error: expected ‘,’ or ‘...’ before ‘&&’ token
  284 |   RtMidiIn(RtMidiIn&& other) noexcept : RtMidi(std::move(other)) { }
      |                    ^~
/usr/include/rtmidi/RtMidi.h:284:3: error: invalid constructor; you probably meant ‘RtMidiIn (const RtMidiIn&)’
  284 |   RtMidiIn(RtMidiIn&& other) noexcept : RtMidi(std::move(other)) { }
      |   ^~~~~~~~
/usr/include/rtmidi/RtMidi.h:284:28: error: expected ‘;’ at end of member declaration
  284 |   RtMidiIn(RtMidiIn&& other) noexcept : RtMidi(std::move(other)) { }
      |                            ^
      |                             ;
/usr/include/rtmidi/RtMidi.h:284:30: error: ‘noexcept’ does not name a type
  284 |   RtMidiIn(RtMidiIn&& other) noexcept : RtMidi(std::move(other)) { }
      |                              ^~~~~~~~
/usr/include/rtmidi/RtMidi.h:284:30: note: C++11 ‘noexcept’ only available with ‘-std=c++11’ or ‘-std=gnu++11’
In file included from /build/milkytracker/src/MilkyTracker-1.03.00/src/midi/posix/MidiReceiver_pthread.cpp:34:
/usr/include/rtmidi/RtMidi.h:428:22: error: expected ‘,’ or ‘...’ before ‘&&’ token
  428 |   RtMidiOut(RtMidiOut&& other) noexcept : RtMidi(std::move(other)) { }
      |                      ^~
/usr/include/rtmidi/RtMidi.h:428:3: error: invalid constructor; you probably meant ‘RtMidiOut (const RtMidiOut&)’
  428 |   RtMidiOut(RtMidiOut&& other) noexcept : RtMidi(std::move(other)) { }
      |   ^~~~~~~~~
/usr/include/rtmidi/RtMidi.h:428:30: error: expected ‘;’ at end of member declaration
  428 |   RtMidiOut(RtMidiOut&& other) noexcept : RtMidi(std::move(other)) { }
      |                              ^
      |                               ;
/usr/include/rtmidi/RtMidi.h:428:32: error: ‘noexcept’ does not name a type
  428 |   RtMidiOut(RtMidiOut&& other) noexcept : RtMidi(std::move(other)) { }
      |                                ^~~~~~~~
/usr/include/rtmidi/RtMidi.h:428:32: note: C++11 ‘noexcept’ only available with ‘-std=c++11’ or ‘-std=gnu++11’

Are there any plans to update this project's C++ standard? :)

umlaeute commented 2 years ago

the obvious "fix" (that i'm employing for the Debian package) is to simply set the CMAKE_CXX_STANDARD to 11 in https://github.com/milkytracker/MilkyTracker/blob/3533e5d836e3ac642b277b0a96ba044a9af5d8d4/CMakeLists.txt#L25-L26

afaict, setting this value to 98 is an attempt to keep the codebase of milkytracker itself clean of newer C++ constructs (probably to allow compilation on older compilers) but there's nothing really enforcing the old standard in the codebase.

dvzrv commented 2 years ago

@umlaeute yes, that's also what I ended up doing.

From an outsider's perspective it would be great to be able to solve this upstream of course.

caseyjoy commented 2 years ago

While there might be a way to keep using C++98, after doing some investigating, I'm thinking it'd probably be okay to bump the Milkytracker C++ standard up to C++11 officially:

Primary versions should be fine:

Other versions:

coderofsalvation commented 1 year ago

thank you very much, it has been adressed in v1.04 🎉