dhemery / DHE-Modules

VCV rack modules from Dale Emery
MIT License
33 stars 2 forks source link

Rack v1: Compile fails on Linux and Windows #15

Closed cschol closed 5 years ago

cschol commented 5 years ago

Version 1.0.0 of the plugin does not compile on GNU/Linux (Ubuntu 18.04, g++ 7.4.0) and Windows (x86_64-w64-mingw32-g++ 7.3-posix 20180312).

In file included from src/modules/Swave.cpp:1:0:
./include/modules/Swave.h:20:8: error: ‘unique_ptr’ in namespace ‘std’ does not name a template type
   std::unique_ptr<CurvatureControl> shape;
        ^~~~~~~~~~
src/modules/Swave.cpp: In constructor ‘DHE::Swave::Swave()’:
src/modules/Swave.cpp:15:3: error: ‘shape’ was not declared in this scope
   shape = std::unique_ptr<CurvatureControl>(new CurvatureControl(
   ^~~~~
src/modules/Swave.cpp:15:3: note: suggested alternative: ‘scale’
   shape = std::unique_ptr<CurvatureControl>(new CurvatureControl(
   ^~~~~
   scale
src/modules/Swave.cpp:15:16: error: ‘unique_ptr’ is not a member of ‘std’
   shape = std::unique_ptr<CurvatureControl>(new CurvatureControl(
                ^~~~~~~~~~
src/modules/Swave.cpp:15:16: note: suggested alternative: ‘unique_copy’
   shape = std::unique_ptr<CurvatureControl>(new CurvatureControl(
                ^~~~~~~~~~
                unique_copy
src/modules/Swave.cpp:15:43: error: expected primary-expression before ‘>’ token
   shape = std::unique_ptr<CurvatureControl>(new CurvatureControl(
                                           ^
src/modules/Swave.cpp: In member function ‘virtual void DHE::Swave::process(const rack::engine::Module::ProcessArgs&)’:
src/modules/Swave.cpp:21:23: error: ‘shape’ was not declared in this scope
   auto const shaped = shape->taper(normalized);
                       ^~~~~
src/modules/Swave.cpp:21:23: note: suggested alternative: ‘shaped’
   auto const shaped = shape->taper(normalized);
                       ^~~~~
                       shaped
/home/cschol/src/Rack-1.0/compile.mk:61: recipe for target 'build/src/modules/Swave.cpp.o' failed
make: *** [build/src/modules/Swave.cpp.o] Error 1

Mac compilation works without error.

The following changes resolve the issues on GNU/Linux and Windows:

diff --git a/include/modules/Swave.h b/include/modules/Swave.h
index ed8cc38..72c77e6 100644
--- a/include/modules/Swave.h
+++ b/include/modules/Swave.h
@@ -1,5 +1,6 @@
 #pragma once

+#include <memory>
 #include "Module.h"
 #include "modules/controls/CurvatureControl.h"

diff --git a/include/panels/func/FuncSteppers.h b/include/panels/func/FuncSteppers.h
index f7f434c..cf2bb16 100644
--- a/include/panels/func/FuncSteppers.h
+++ b/include/panels/func/FuncSteppers.h
@@ -1,5 +1,7 @@
 #pragma once

+#include <functional>
+
 namespace DHE {
 template <typename P> class MultiplicationRangeStepper : public Toggle<P, 4> {
 public:
dhemery commented 5 years ago

Fixed 622f1b6ce486174f5da7a171808227702d44380c