Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
techno-womble opened this issue Jul 25, 2023 · 3 comments · Fixed by #195
Closed

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

techno-womble opened this issue Jul 25, 2023 · 3 comments · Fixed by #195
Labels

Comments

@techno-womble
Copy link

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

@tomcombriat
Copy link
Collaborator

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!

@tomcombriat
Copy link
Collaborator

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

Thanks!

@techno-womble
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants