sensorium / Mozzi

sound synthesis library for Arduino

Home Page:https://sensorium.github.io/Mozzi/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Compilation errors when including both WaveFolder.h and ResonantFilter.h

techno-womble opened this issue · comments

Hi,
The following sketch produces multiple compile errors

#include <MozziGuts.h>
#include <WaveFolder.h>
#include <LowPassFilter.h>

void setup() {
// put your setup code here, to run once:
}

void loop() {
// put your main code here, to run repeatedly:
}

The errors are repeatable on two PCs and take the following form :-

In file included from /home/john/Arduino/libraries/Mozzi/ResonantFilter.h:16:0,
from /home/john/Arduino/libraries/Mozzi/LowPassFilter.h:16,
from /home/john/Desktop/LPFandWF/LPFandWF.ino:3:
/home/john/Arduino/libraries/Mozzi/IntegerType.h:2:32: error: redefinition of 'struct IntegerType'
template<uint8_t BYTES> struct IntegerType {

^~~~~~~~~~~

_

After some playing around I eliminated the compilation errors by adding #ifndef /#define directives to the file IntegerType.h. I must admit, I'm a bit out of my depth here so I thought I'd better log it for someone else to take a look at.

Many thanks
John

Hi,
Did not see that coming! Indeed, preproc directives to ensure this file is included only once is the correct solution. I will try to do this today but if you are faster do not hesitate to submit a PR!

Thanks for reporting this!

Hi again,
@techno-womble could you please give #195 a try and report back (do not have hardware available now).

Thanks!

Tested and works perfectly.
Thanks and keep up the great work!
John