Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incompatible with rtmidi 5.0.0 #262

Closed
dvzrv opened this issue Nov 19, 2021 · 4 comments
Closed

Incompatible with rtmidi 5.0.0 #262

dvzrv opened this issue Nov 19, 2021 · 4 comments

Comments

@dvzrv
Copy link

dvzrv commented Nov 19, 2021

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
Copy link

the obvious "fix" (that i'm employing for the Debian package) is to simply set the CMAKE_CXX_STANDARD to 11 in

# Set C++ standard to C++98
set(CMAKE_CXX_STANDARD 98)

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
Copy link
Author

dvzrv commented Nov 30, 2021

@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 added a commit to caseyjoy/MilkyTracker that referenced this issue Jan 1, 2022
@caseyjoy
Copy link
Contributor

caseyjoy commented Jan 1, 2022

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:

  • Linux/BSD/Windows/Mac builds should all be fine since they should all have access to more recent versions of gcc/g++
  • The Amiga version fork looks like it probably has access to a gcc/g++ with c++11 support 1234, and the change could be omitted in the fork if it doesn't

Other versions:

OPNA2608 added a commit to OPNA2608/nixpkgs that referenced this issue Jan 16, 2022
RtMidi 5.0.0 requires C++11 support now.
Upstream bug: milkytracker/MilkyTracker#262
@coderofsalvation
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants