Closed Malifick closed 7 years ago
I think from the note on the front page that it is built against a previous dev commit. I can't build it (on Mac) either.
ya I'm building it on linux
On closer examination my errors are different to yours. I'm not a dev but a quick google leads me to suspect that this a problem with cmake on my Mac and that it would compile with gcc.
MBP:vcv-gratrix nik$ make
c++ -fPIC -I../../include -I../../dep/include -MMD -g -O3 -march=nocona -ffast-math -fno-finite-math-only -Wall -Wextra -Wno-unused-parameter -DARCH_MAC -mmacosx-version-min=10.7 -std=c++11 -stdlib=libc++ -c -o build/src/ADSR.cpp.o src/ADSR.cpp
In file included from src/ADSR.cpp:1:
src/Gratrix.hpp:32:18: error: constexpr function never produces a constant expression
[-Winvalid-constexpr]
constexpr double dx(double i, std::size_t n) { return std::sin(GTX2PI * static_cast<doub...
^
src/Gratrix.hpp:32:56: note: non-constexpr function 'sin' cannot be used in a constant expression
constexpr double dx(double i, std::size_t n) { return std::sin(GTX2PI static_cast<doub...
^
/usr/include/math.h:343:15: note: declared here
extern double sin(double);
^
In file included from src/ADSR.cpp:1:
src/Gratrix.hpp:33:18: error: constexpr function never produces a constant expression
[-Winvalid-constexpr]
constexpr double dy(double i, std::size_t n) { return -std::cos(GTX__2PI static_cast<doub...
^
src/Gratrix.hpp:33:56: note: non-constexpr function 'cos' cannot be used in a constant expression
constexpr double dy(double i, std::size_t n) { return -std::cos(GTX__2PI static_cast<doub...
^
/usr/include/math.h:339:15: note: declared here
extern double cos(double);
^
In file included from src/ADSR.cpp:1:
src/Gratrix.hpp:37:18: error: constexpr function never produces a constant expression
[-Winvalid-constexpr]
constexpr int gx(double i) { return static_cast~
../../include/app.hpp:37:25: note: passing argument to parameter 'module' here
void setModule(Module module);
^
src/ADSR.cpp:173:11: error: no matching function for call to 'createParam'
addParam(createParam~~~~~~
../../include/rack.hpp:38:14: note: candidate function [with TParam = rack::RoundBlackKnob] not
viable: no known conversion from 'ADSRBank ' to 'rack::Module ' for 2nd argument
ParamWidget createParam(Vec pos, Module module, int paramId, float minValue, float maxVal...
^
src/ADSR.cpp:174:11: error: no matching function for call to 'createParam'
addParam(createParam~~~~~~
../../include/rack.hpp:38:14: note: candidate function [with TParam = rack::RoundBlackKnob] not
viable: no known conversion from 'ADSRBank ' to 'rack::Module ' for 2nd argument
ParamWidget createParam(Vec pos, Module module, int paramId, float minValue, float maxVal...
^
src/ADSR.cpp:175:11: error: no matching function for call to 'createParam'
addParam(createParam~~~~~~
../../include/rack.hpp:38:14: note: candidate function [with TParam = rack::RoundBlackKnob] not
viable: no known conversion from 'ADSRBank ' to 'rack::Module ' for 2nd argument
ParamWidget createParam(Vec pos, Module module, int paramId, float minValue, float maxVal...
^
src/ADSR.cpp:176:11: error: no matching function for call to 'createParam'
addParam(createParam~~~~~~
../../include/rack.hpp:38:14: note: candidate function [with TParam = rack::RoundBlackKnob] not
viable: no known conversion from 'ADSRBank ' to 'rack::Module ' for 2nd argument
ParamWidget createParam(Vec pos, Module module, int paramId, float minValue, float maxVal...
^
src/ADSR.cpp:178:11: error: no matching function for call to 'createInput'
addInput(createInput~~~~~~
../../include/rack.hpp:49:7: note: candidate function [with TPort = rack::PJ301MPort] not viable:
no known conversion from 'ADSRBank ' to 'rack::Module ' for 2nd argument
Port createInput(Vec pos, Module module, int inputId) {
^
src/ADSR.cpp:179:11: error: no matching function for call to 'createInput'
addInput(createInput~~~~~~
../../include/rack.hpp:49:7: note: candidate function [with TPort = rack::PJ301MPort] not viable:
no known conversion from 'ADSRBank ' to 'rack::Module ' for 2nd argument
Port createInput(Vec pos, Module module, int inputId) {
^
src/ADSR.cpp:180:11: error: no matching function for call to 'createInput'
addInput(createInput~~~~~~
../../include/rack.hpp:49:7: note: candidate function [with TPort = rack::PJ301MPort] not viable:
no known conversion from 'ADSRBank ' to 'rack::Module ' for 2nd argument
Port createInput(Vec pos, Module module, int inputId) {
^
src/ADSR.cpp:181:11: error: no matching function for call to 'createInput'
addInput(createInput~~~~~~
../../include/rack.hpp:49:7: note: candidate function [with TPort = rack::PJ301MPort] not viable:
no known conversion from 'ADSRBank ' to 'rack::Module ' for 2nd argument
Port createInput(Vec pos, Module module, int inputId) {
^
src/ADSR.cpp:185:12: error: no matching function for call to 'createInput'
addInput(createInput~~~~~~
../../include/rack.hpp:49:7: note: candidate function [with TPort = rack::PJ301MPort] not viable:
no known conversion from 'ADSRBank ' to 'rack::Module ' for 2nd argument
Port createInput(Vec pos, Module module, int inputId) {
^
src/ADSR.cpp:186:12: error: no matching function for call to 'createInput'
addInput(createInput~~~~~~
../../include/rack.hpp:49:7: note: candidate function [with TPort = rack::PJ301MPort] not viable:
no known conversion from 'ADSRBank ' to 'rack::Module ' for 2nd argument
Port createInput(Vec pos, Module module, int inputId) {
^
src/ADSR.cpp:188:13: error: no matching function for call to 'createOutput'
addOutput(createOutput~~~~~~~
../../include/rack.hpp:59:7: note: candidate function [with TPort = rack::PJ301MPort] not viable:
no known conversion from 'ADSRBank ' to 'rack::Module ' for 2nd argument
Port createOutput(Vec pos, Module module, int outputId) {
^
src/ADSR.cpp:189:13: error: no matching function for call to 'createOutput'
addOutput(createOutput~~~~~~~
../../include/rack.hpp:59:7: note: candidate function [with TPort = rack::PJ301MPort] not viable:
no known conversion from 'ADSRBank ' to 'rack::Module ' for 2nd argument
Port createOutput(Vec pos, Module module, int outputId) {
^
src/ADSR.cpp:192:11: error: no matching function for call to 'createInput'
addInput(createInput~~~~~~
../../include/rack.hpp:49:7: note: candidate function [with TPort = rack::PJ301MPort] not viable:
no known conversion from 'ADSRBank ' to 'rack::Module ' for 2nd argument
Port createInput(Vec pos, Module module, int inputId) {
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make: *** [build/src/ADSR.cpp.o] Error 1
Yeah I am doing it with gcc
I can't compile on windows
g++ -fPIC -I../../include -I../../dep/include -DVERSION=dev -DVERSION_dev -MMD -O3 -march=nocona -ffast-math -Wall -g -DARCH_WIN -D_USE_MATH_DEFINES -std=c++11 -c -o build/src/Gratrix.cpp.o src/Gratrix.cpp
src/Gratrix.cpp: In function 'void init(rack::Plugin)':
src/Gratrix.cpp:10:5: error: 'struct rack::Plugin' has no member named 'version'
p->version = TOSTRING(VERSION);
^~~
src/Gratrix.cpp:12:5: error: 'struct rack::Plugin' has no member named 'addModel'
p->addModel(createModel~~~
src/Gratrix.cpp:12:83: error: no matching function for call to 'createModel(const char [8], const char [8], const char [7], const char [7])'
p->addModel(createModel~~
../../include/rack.hpp:21:8: note: template argument deduction/substitution failed:
src/Gratrix.cpp:12:83: note: candidate expects 3 arguments, 4 provided
p->addModel(createModel~~~
src/Gratrix.cpp:13:83: error: no matching function for call to 'createModel(const char [8], const char [8], const char [7], const char [7])'
p->addModel(createModel~~
../../include/rack.hpp:21:8: note: template argument deduction/substitution failed:
src/Gratrix.cpp:13:83: note: candidate expects 3 arguments, 4 provided
p->addModel(createModel~~~
src/Gratrix.cpp:14:83: error: no matching function for call to 'createModel(const char [8], const char [8], const char [7], const char [7])'
p->addModel(createModel~~
../../include/rack.hpp:21:8: note: template argument deduction/substitution failed:
src/Gratrix.cpp:14:83: note: candidate expects 3 arguments, 4 provided
p->addModel(createModel~~~
src/Gratrix.cpp:15:83: error: no matching function for call to 'createModel(const char [8], const char [8], const char [7], const char [7])'
p->addModel(createModel~~
../../include/rack.hpp:21:8: note: template argument deduction/substitution failed:
src/Gratrix.cpp:15:83: note: candidate expects 3 arguments, 4 provided
p->addModel(createModel~~~
src/Gratrix.cpp:16:83: error: no matching function for call to 'createModel(const char [8], const char [8], const char [7], const char [7])'
p->addModel(createModel~~
../../include/rack.hpp:21:8: note: template argument deduction/substitution failed:
src/Gratrix.cpp:16:83: note: candidate expects 3 arguments, 4 provided
p->addModel(createModel~~~
src/Gratrix.cpp:17:85: error: no matching function for call to 'createModel(const char [8], const char [8], const char [8], const char [9])'
p->addModel(createModel~~
../../include/rack.hpp:21:8: note: template argument deduction/substitution failed:
src/Gratrix.cpp:17:85: note: candidate expects 3 arguments, 4 provided
p->addModel(createModel~~~
src/Gratrix.cpp:18:84: error: no matching function for call to 'createModel(const char [8], const char [8], const char [8], const char [8])'
p->addModel(createModel~~
../../include/rack.hpp:21:8: note: template argument deduction/substitution failed:
src/Gratrix.cpp:18:84: note: candidate expects 3 arguments, 4 provided
p->addModel(createModel~~~
src/Gratrix.cpp:19:84: error: no matching function for call to 'createModel(const char [8], const char [8], const char [8], const char [8])'
p->addModel(createModel~~
../../include/rack.hpp:21:8: note: template argument deduction/substitution failed:
src/Gratrix.cpp:19:84: note: candidate expects 3 arguments, 4 provided
p->addModel(createModel~~~
src/Gratrix.cpp:22:83: error: no matching function for call to 'createModel(const char [8], const char [8], const char [7], const char [7])'
p->addModel(createModel~~
../../include/rack.hpp:21:8: note: template argument deduction/substitution failed:
src/Gratrix.cpp:22:83: note: candidate expects 3 arguments, 4 provided
p->addModel(createModel~~~
src/Gratrix.cpp:23:84: error: no matching function for call to 'createModel(const char [8], const char [8], const char [7], const char [8])'
p->addModel(createModel~~
../../include/rack.hpp:21:8: note: template argument deduction/substitution failed:
src/Gratrix.cpp:23:84: note: candidate expects 3 arguments, 4 provided
p->addModel(createModel~~~
src/Gratrix.cpp:24:84: error: no matching function for call to 'createModel(const char [8], const char [8], const char [7], const char [8])'
p->addModel(createModel~~
../../include/rack.hpp:21:8: note: template argument deduction/substitution failed:
src/Gratrix.cpp:24:84: note: candidate expects 3 arguments, 4 provided
p->addModel(createModel~~~
src/Gratrix.cpp:25:84: error: no matching function for call to 'createModel(const char [8], const char [8], const char [7], const char [8])'
p->addModel(createModel~~
../../include/rack.hpp:21:8: note: template argument deduction/substitution failed:
src/Gratrix.cpp:25:84: note: candidate expects 3 arguments, 4 provided
p->addModel(createModel~~~
src/Gratrix.cpp:26:85: error: no matching function for call to 'createModel(const char [8], const char [8], const char [8], const char [9])'
p->addModel(createModel~~
../../include/rack.hpp:21:8: note: template argument deduction/substitution failed:
src/Gratrix.cpp:26:85: note: candidate expects 3 arguments, 4 provided
p->addModel(createModel
Sorry about the constexpr sin/cos issue, it compiled fine on Windows. Done a bit of digging any maybe in general sin/cos are not constexpr. For now, replace constexpr with inline. I won't be able to make any commits until this evening UK time.
lorez22 I think you need to update your version of Rack. have a look at http://www.switchedonrack.com/attention-developers-changes-in-api.html
No worries. Using inline got rid of the first set of errors but it bombs out in ADSR.cpp still:
MBP:vcv-gratrix nik$ make
c++ -fPIC -I../../include -I../../dep/include -MMD -g -O3 -march=nocona -ffast-math -fno-finite-math-only -Wall -Wextra -Wno-unused-parameter -DARCH_MAC -mmacosx-version-min=10.7 -std=c++11 -stdlib=libc++ -c -o build/src/ADSR.cpp.o src/ADSR.cpp
src/ADSR.cpp:103:27: error: implicit instantiation of undefined template 'std::1::array<ADSR, 6>'
std::array<ADSR, GTXN> inst;
^
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/__tuple:116:65: note: template is
declared here
template <class _Tp, size_t _Size> struct _LIBCPP_TYPE_VIS_ONLY array;
^
src/ADSR.cpp:143:12: error: cannot initialize a parameter of type 'rack::Module ' with an lvalue
of type 'ADSRBank '
setModule(module);
^~
../../include/app.hpp:37:25: note: passing argument to parameter 'module' here
void setModule(Module module);
^
src/ADSR.cpp:173:11: error: no matching function for call to 'createParam'
addParam(createParam~~~~~~
../../include/rack.hpp:38:14: note: candidate function [with TParam = rack::RoundBlackKnob] not
viable: no known conversion from 'ADSRBank ~~~~~~
../../include/rack.hpp:38:14: note: candidate function [with TParam = rack::RoundBlackKnob] not
viable: no known conversion from 'ADSRBank ~~~~~~
../../include/rack.hpp:38:14: note: candidate function [with TParam = rack::RoundBlackKnob] not
viable: no known conversion from 'ADSRBank ~~~~~~
../../include/rack.hpp:38:14: note: candidate function [with TParam = rack::RoundBlackKnob] not
viable: no known conversion from 'ADSRBank ~~~~~~
../../include/rack.hpp:49:7: note: candidate function [with TPort = rack::PJ301MPort] not viable:
no known conversion from 'ADSRBank ~~~~~~
../../include/rack.hpp:49:7: note: candidate function [with TPort = rack::PJ301MPort] not viable:
no known conversion from 'ADSRBank ~~~~~~
../../include/rack.hpp:49:7: note: candidate function [with TPort = rack::PJ301MPort] not viable:
no known conversion from 'ADSRBank ~~~~~~
../../include/rack.hpp:49:7: note: candidate function [with TPort = rack::PJ301MPort] not viable:
no known conversion from 'ADSRBank ~~~~~~
../../include/rack.hpp:49:7: note: candidate function [with TPort = rack::PJ301MPort] not viable:
no known conversion from 'ADSRBank ~~~~~~
../../include/rack.hpp:49:7: note: candidate function [with TPort = rack::PJ301MPort] not viable:
no known conversion from 'ADSRBank ~~~~~~~
../../include/rack.hpp:59:7: note: candidate function [with TPort = rack::PJ301MPort] not viable:
no known conversion from 'ADSRBank ~~~~~~~
../../include/rack.hpp:59:7: note: candidate function [with TPort = rack::PJ301MPort] not viable:
no known conversion from 'ADSRBank ~~~~~~
../../include/rack.hpp:49:7: note: candidate function [with TPort = rack::PJ301MPort] not viable:
no known conversion from 'ADSRBank ~~~~~~
../../include/rack.hpp:49:7: note: candidate function [with TPort = rack::PJ301MPort] not viable:
no known conversion from 'ADSRBank
Very quick inspection I may have missed out #include <array>
at the top of gratrix.hpp - If I did I don't know how this compiled at my end!
Fixed :) !! Got no time to play now but will look forward to this later. Modules look great. Many thanks :)
So, for anybody else who reads this:
To compile this on a mac:
You need the latest dev build.
In Gratrix.hpp add #include <array>
to the top, and replace all instances of constexpr with inline.
In chord12.cpp edit 197-200 to replace const.expr with inline.
In octave.cpp do the same at 88 & 89.
DON'T do a sed replace for this edit on all the source files.
Inikj thank you for summarising the fixes. I think they'll apply to all builds. I'll commit changes 2, 3 and 4 soon as I get time.
You're very welcome :) Thanks so much for the modules and your help in getting them running :)
One thing to point out, as the repo is at the moment each module will generate an SVG file. I then use a script to convert these to PNG which is currently used in the module load. I will commit a change that will disable this auto generation (which is not need as the PNGs are also committed). I had hoped to use the SVG in VCV Rack but when I tried it last the SVG fonts didn't work. Anyway, PNG is fine for now and I'll revisit this later.
I have found that the fonts are ever so slightly fuzzy when zoomed in - is this the reason? (I am running the dev version because I have poor eyesight and love the new zoom feature).
Yes it is because of the PNG. I'll investigate getting the SVG working.
Now added guards to stop SVG generation.
is the gratrix compiling ok on linux now? I'll try it again
src/Gratrix.cpp:25:5: error: ‘struct rack::Plugin’ has no member named ‘addModel’ p->addModel(createModel ("Gratrix", "Gratrix", "Blank9", "Blank 9"));
^(const char [8], const char [8], const char [7], const char [8])’
Model(createModel ("Gratrix", "Gratrix", "Blank9", "Blank 9"));
^
In file included from src/Gratrix.hpp:3:0,
from src/Gratrix.cpp:1:
../../include/rack.hpp:21:8: note: candidate: template rack::Model rack::createModel(rack::Plugin, std::cxx11::string, std::cxx11::string)
Model createModel(Plugin plugin, std::string slug, std::string name) {
^ ("Gratrix", "Gratrix", "Blank9", "Blank 9"));
^
src/Gratrix.cpp:26:5: error: ‘struct rack::Plugin’ has no member named ‘addModel’
p->addModel(createModel ("Gratrix", "Gratrix", "Blank12", "Blank 12"));
^(const char [8], const char [8], const char [8], const char [9])’
odel(createModel ("Gratrix", "Gratrix", "Blank12", "Blank 12"));
^
In file included from src/Gratrix.hpp:3:0,
from src/Gratrix.cpp:1:
../../include/rack.hpp:21:8: note: candidate: template rack::Model rack::createModel(rack::Plugin, std::cxx11::string, std::cxx11::string)
Model createModel(Plugin plugin, std::string slug, std::string name) {
^ ("Gratrix", "Gratrix", "Blank12", "Blank 12"));
^
make: *** [../../compile.mk:55: build/src/Gratrix.cpp.o] Error 1
~~~ src/Gratrix.cpp:25:84: error: no matching function for call to ‘createModel~~../../include/rack.hpp:21:8: note: template argument deduction/substitution failed: src/Gratrix.cpp:25:84: note: candidate expects 3 arguments, 4 provided Model(createModel~~~ src/Gratrix.cpp:26:85: error: no matching function for call to ‘createModel~~../../include/rack.hpp:21:8: note: template argument deduction/substitution failed: src/Gratrix.cpp:26:85: note: candidate expects 3 arguments, 4 provided odel(createModel