matthiassars / vanTies

a plugin for VCV Rack
GNU General Public License v3.0
3 stars 1 forks source link

build failure #1

Open davephillips opened 1 year ago

davephillips commented 1 year ago

Building on a Mac M1 (Rosetta mode), hit this problem. Any suggestions for a repair ?

c++  -std=c++11 -stdlib=libc++   -fPIC -I../../include -I../../dep/include -MMD -MP -g -O3 -funsafe-math-optimizations -fno-omit-frame-pointer -Wall -Wextra -Wno-unused-parameter -DARCH_X64 -march=nehalem -DARCH_MAC -mmacosx-version-min=10.9  -c -o build/src/Append.cpp.o src/Append.cpp
src/Shuffle.cpp:37:22: error: implicit instantiation of undefined template 'std::array<int, 16>'
        std::array<int, 16> reorder = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
                            ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__tuple:219:64: note: template is declared here
template <class _Tp, size_t _Size> struct _LIBCPP_TEMPLATE_VIS array;
                                                               ^
src/Shuffle.cpp:42:24: error: implicit instantiation of undefined template 'std::array<float, 16>'
        std::array<float, 16> defaultVoltages = {0.f/12, 1.f/12, 2.f/12, 3.f/12, 4.f/12, 5.f/12, 6.f/12, 7.f/12, 8.f/12, 9.f/12, 10.f/12, 11.f/12, 12.f/12, 13.f/12, 14.f/12, 15.f/12};
                              ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__tuple:219:64: note: template is declared here
template <class _Tp, size_t _Size> struct _LIBCPP_TEMPLATE_VIS array;
                                                               ^
src/Shuffle.cpp:43:24: error: implicit instantiation of undefined template 'std::array<float, 16>'
        std::array<float, 16> inputVoltages = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0};
                              ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__tuple:219:64: note: template is declared here
template <class _Tp, size_t _Size> struct _LIBCPP_TEMPLATE_VIS array;
                                                               ^
src/Shuffle.cpp:25:3: error: cannot initialize object parameter of type 'rack::engine::Module' with an expression of type 'Shuffle'
                config(PARAMS_LEN, INPUTS_LEN, OUTPUTS_LEN, LIGHTS_LEN);
                ^~~~~~
src/Shuffle.cpp:26:3: error: no matching member function for call to 'configParam'
                configParam(TOGGLE_SWITCH, 0.f, 1.f, 0.f, "Allow duplicate outputs");
                ^~~~~~~~~~~
../../include/engine/Module.hpp:125:18: note: candidate function template not viable: no known conversion from 'Shuffle' to 'rack::engine::Module' for object argument
        TParamQuantity* configParam(int paramId, float minValue, float maxValue, float defaultValue, std::string name = "", std::string unit = "", float displayBase = 0.f, float displayMultiplier = 1.f, float displayOffset = 0.f) {
                        ^
src/Shuffle.cpp:27:3: error: no matching member function for call to 'configInput'
                configInput(TRIGGER_INPUT, "Shuffle Trigger");
                ^~~~~~~~~~~
../../include/engine/Module.hpp:174:13: note: candidate function template not viable: no known conversion from 'Shuffle' to 'rack::engine::Module' for object argument
        TPortInfo* configInput(int portId, std::string name = "") {
                   ^
src/Shuffle.cpp:28:3: error: no matching member function for call to 'configInput'
                configInput(POLYPHONIC_PITCH_INPUT, "Poly In");
                ^~~~~~~~~~~
../../include/engine/Module.hpp:174:13: note: candidate function template not viable: no known conversion from 'Shuffle' to 'rack::engine::Module' for object argument
        TPortInfo* configInput(int portId, std::string name = "") {
                   ^
src/Shuffle.cpp:29:3: error: no matching member function for call to 'configInput'
                configInput(SEED_INPUT, "Seed");
                ^~~~~~~~~~~
../../include/engine/Module.hpp:174:13: note: candidate function template not viable: no known conversion from 'Shuffle' to 'rack::engine::Module' for object argument
        TPortInfo* configInput(int portId, std::string name = "") {
                   ^
src/Shuffle.cpp:30:3: error: no matching member function for call to 'configInput'
                configInput(OUTPUT_CHANNELS_INPUT, "Number of Output Channels (0v 'one', to 10v 'all')");
                ^~~~~~~~~~~
../../include/engine/Module.hpp:174:13: note: candidate function template not viable: no known conversion from 'Shuffle' to 'rack::engine::Module' for object argument
        TPortInfo* configInput(int portId, std::string name = "") {
                   ^
src/Shuffle.cpp:31:3: error: no matching member function for call to 'configOutput'
                configOutput(REORDERED_PITCH_OUTPUT, "Poly Out");
                ^~~~~~~~~~~~
../../include/engine/Module.hpp:193:13: note: candidate function template not viable: no known conversion from 'Shuffle' to 'rack::engine::Module' for object argument
        TPortInfo* configOutput(int portId, std::string name = "") {
                   ^
src/Shuffle.cpp:180:13: error: cannot initialize a parameter of type 'engine::Module *' with an lvalue of type 'Shuffle *'
                setModule(module);
                          ^~~~~~
../../include/app/ModuleWidget.hpp:46:33: note: passing argument to parameter 'module' here
        void setModule(engine::Module* module);
                                       ^
src/Shuffle.cpp:188:12: error: no matching function for call to 'createParamCentered'
                addParam(createParamCentered<BrassToggle>(mm2px(Vec(15, 6)), module, Shuffle::TOGGLE_SWITCH));
                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../include/helpers.hpp:87:15: note: candidate function template not viable: no known conversion from 'Shuffle *' to 'engine::Module *' for 2nd argument
TParamWidget* createParamCentered(math::Vec pos, engine::Module* module, int paramId) {
              ^
src/Shuffle.cpp:190:12: error: no matching function for call to 'createInputCentered'
                addInput(createInputCentered<BrassPort>(mm2px(Vec(8.625, 65.012)), module, Shuffle::TRIGGER_INPUT));
                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../include/helpers.hpp:106:14: note: candidate function template not viable: no known conversion from 'Shuffle *' to 'engine::Module *' for 2nd argument
TPortWidget* createInputCentered(math::Vec pos, engine::Module* module, int inputId) {
             ^
src/Shuffle.cpp:191:12: error: no matching function for call to 'createInputCentered'
                addInput(createInputCentered<BrassPort>(mm2px(Vec(8.625, 76.981)), module, Shuffle::POLYPHONIC_PITCH_INPUT));
                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../include/helpers.hpp:106:14: note: candidate function template not viable: no known conversion from 'Shuffle *' to 'engine::Module *' for 2nd argument
TPortWidget* createInputCentered(math::Vec pos, engine::Module* module, int inputId) {
             ^
src/Shuffle.cpp:192:12: error: no matching function for call to 'createInputCentered'
                addInput(createInputCentered<BrassPort>(mm2px(Vec(8.625, 88.949)), module, Shuffle::SEED_INPUT));
                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../include/helpers.hpp:106:14: note: candidate function template not viable: no known conversion from 'Shuffle *' to 'engine::Module *' for 2nd argument
TPortWidget* createInputCentered(math::Vec pos, engine::Module* module, int inputId) {
             ^
src/Shuffle.cpp:193:12: error: no matching function for call to 'createInputCentered'
                addInput(createInputCentered<BrassPort>(mm2px(Vec(8.625, 100.918)), module, Shuffle::OUTPUT_CHANNELS_INPUT));
                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../include/helpers.hpp:106:14: note: candidate function template not viable: no known conversion from 'Shuffle *' to 'engine::Module *' for 2nd argument
TPortWidget* createInputCentered(math::Vec pos, engine::Module* module, int inputId) {
             ^
src/Shuffle.cpp:195:13: error: no matching function for call to 'createOutputCentered'
                addOutput(createOutputCentered<BrassPortOut>(mm2px(Vec(8.625, 112.887)), module, Shuffle::REORDERED_PITCH_OUTPUT));
                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../include/helpers.hpp:125:14: note: candidate function template not viable: no known conversion from 'Shuffle *' to 'engine::Module *' for 2nd argument
TPortWidget* createOutputCentered(math::Vec pos, engine::Module* module, int outputId) {
             ^
../../include/helpers.hpp:27:20: error: cannot initialize a variable of type 'engine::Module *' with an rvalue of type 'Shuffle *'
                        engine::Module* m = new TModule;
                                        ^   ~~~
../../include/helpers.hpp:25:9: note: in instantiation of member function 'rack::createModel(std::string)::TModel::createModule' requested here
        struct TModel : plugin::Model {
               ^
src/Shuffle.cpp:199:23: note: in instantiation of function template specialization 'rack::createModel<Shuffle, ShuffleWidget>' requested here
Model* modelShuffle = createModel<Shuffle, ShuffleWidget>("Shuffle");
                      ^
18 errors generated.
make: *** [build/src/Shuffle.cpp.o] Error 1
make: *** Waiting for unfinished jobs...
matthiassars commented 1 year ago

Hi! I'm sorry, beginner here, so I don't know what's going on. Do you have VCV Rack?

davephillips commented 1 year ago

@matthiassars - Yes, I compile it locally. I'm currently running v2.3.0 on a Mac M1 in Rosetta mode (x64 architecture). The function in question is in helpers.hpp which is #include'd in rack.hpp. Maybe a syntax issue ? I'll do some debugging to see where it's breaking down here, will report back later today.

davephillips commented 1 year ago

@matthiassars - No problem now. I did a make clean and rebuilt with no issues. I'll test the plugin later today.