almostEric / FrozenWasteland

Plugins for VCV Rack
Other
91 stars 18 forks source link

[SOLVED] build fail with latest Rack git source #21

Closed davephillips closed 4 years ago

davephillips commented 6 years ago

I figured out the source of the error. Code at FrozenWasteland/src/dsp-delay/ringbuffer.hpp duplicates code found in Rack/include/dsp/ringbuffer.hpp, which is used by dsp/samplerate.hpp. I commented out the repeated code in dsp-delay/ringbuffer.hpp and also repaired this include in src/HairPick.cpp :

dsp/ringbuffer.hpp

becomes

dsp-delay/ringbuffer.hpp

After those fixes everything compiled and runs as expected. Tested with Rack 0.6.2 and Rack v1 dev.

Original message:

Fedora 23 Linux Rack 0.6.x (from source)

Hi Eric, It seems that the most recent changes to some Rack DSP code has resulted in a build error (for me and my ancient compiler, that is):

g++ -Wsuggest-override -std=c++11 -DTEST -I./eurorack -I./src/dsp-delay -I./src/dsp-filter/utils -I./src/dsp-filter/filters -I./src/dsp-filter/third-party/falco -Wno-unused-local-typedefs -DSLUG=FrozenWasteland -fPIC -I../../include -I../../dep/include -DVERSION=0.6.7 -MMD -MP -g -O3 -march=nocona -ffast-math -fno-finite-math-only -Wall -Wextra -Wno-unused-parameter -DARCH_LIN -c -o build/src/HairPick.cpp.o src/HairPick.cpp In file included from src/HairPick.cpp:4:0: ./src/dsp-delay/ringbuffer.hpp:14:8: error: redefinition of ‘struct rack::RingBuffer<T, S>’ struct RingBuffer { ^ In file included from ../../include/dsp/resampler.hpp:7:0, from ../../include/dsp/samplerate.hpp:2, from src/HairPick.cpp:2: ../../include/dsp/ringbuffer.hpp:14:8: error: previous definition of ‘struct rack::RingBuffer<T, S>’ struct RingBuffer { ^ In file included from src/HairPick.cpp:4:0: ./src/dsp-delay/ringbuffer.hpp:72:8: error: redefinition of ‘struct rack::DoubleRingBuffer<T, S>’ struct DoubleRingBuffer { ^ In file included from ../../include/dsp/resampler.hpp:7:0, from ../../include/dsp/samplerate.hpp:2, from src/HairPick.cpp:2: ../../include/dsp/ringbuffer.hpp:71:8: error: previous definition of ‘struct rack::DoubleRingBuffer<T, S>’ struct DoubleRingBuffer { ^ In file included from src/HairPick.cpp:4:0: ./src/dsp-delay/ringbuffer.hpp:296:8: error: redefinition of ‘struct rack::AppleRingBuffer<T, S, N>’ struct AppleRingBuffer { ^ In file included from ../../include/dsp/resampler.hpp:7:0, from ../../include/dsp/samplerate.hpp:2, from src/HairPick.cpp:2: ../../include/dsp/ringbuffer.hpp:140:8: error: previous definition of ‘struct rack::AppleRingBuffer<T, S, N>’ struct AppleRingBuffer { ^ ../../compile.mk:64: recipe for target 'build/src/HairPick.cpp.o' failed make: *** [build/src/HairPick.cpp.o] Error 1

Please advise if there's a handy fix. Or even a not-so-handy one. :)

playaspec commented 6 years ago

@davephillips Can you please elaborate on your fix, or perhaps post a patch? I tried commenting out the redefinition of the three offending functions in dsp-delay/ringbuffer.hpp, but only ended up with a bigger mess of errors.

davephillips commented 6 years ago

@playaspec I pulled the latest sources, rebuilt with Rack-0.6.2b, and got the same error for HairPick. I fixed the build with these changes:

In HairPick.cpp I now have the following includes:

dsp/samplerate.hpp dsp/digital.hpp dsp-delay/ringbuffer.hpp

I edited dsp-delay/ringbuffer.hpp by keeping only the definitions for the ReverseRingBuffer and MultiTapDoubleRingBuffer functions. I've attached my edited file, you'll need to change its name back to ringbuffer.hpp (after backing up the original, of course).

ringbuffer.hpp.txt

I hope it helps, I think I've put in all the steps but let me know if I've left out anything. Built and tested on Fedora 23 LInux, GCC 5.3.1, Rack-0.6.2b built from git source.