Tracktion / tracktion_engine

Tracktion Engine module
Other
1.19k stars 149 forks source link

build fails on Linux / gcc9.3 #62

Closed atsushieno closed 3 years ago

atsushieno commented 3 years ago

I was trying to build tracktion_engine on Ubuntu 20.04 but encountered some build issues. Most notably there are 3 errors on lines like this:

https://github.com/Tracktion/tracktion_engine/blob/67a71640b041719ad1eb21d395c27e8beebd60c5/modules/tracktion_engine/control_surfaces/tracktion_CustomControlSurface.cpp#L440

/sources/Juce_Apps/tracktion_engine/modules/tracktion_engine/control_surfaces/tracktion_CustomControlSurface.cpp:440:45: error: catching polymorphic type ‘struct juce::OSCException’ by value [-Werror=catch-value=]
  440 |                         catch (OSCException err)
      |                                             ^~~

Friend told me that OSCException should be a reference anyways, as the actual exception could be of a derived type.

There is another one at:

/sources/Juce_Apps/tracktion_engine/modules/tracktion_engine/playback/graph/tracktion_EditNodeBuilder.cpp:637:22: error: redundant move in return statement [-Werror=redundant-move]
  637 |     return std::move (sumNode);
      |            ~~~~~~~~~~^~~~~~~~~
/sources/Juce_Apps/tracktion_engine/modules/tracktion_engine/playback/graph/tracktion_EditNodeBuilder.cpp:637:22: note: remove ‘std::move’ call

Both are trivial to fix. I assume that your CI builds use gcc 5.5 and that probably does not report these issues. And probably clang doesn't either.

drowaudio commented 3 years ago

Thanks, these should be fixed with this commit: https://github.com/Tracktion/tracktion_engine/commit/c8504e393bcddda7c8edad023cb42dfe7826f343

We compile with GCC 7 as we need C++17 support. I'll see if I can add some more compilers when I get a chance.