Skip to content

using void loop(){} in .ino file generates: error: redefinition of 'void loop()' #687

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

Closed
jantje opened this issue Mar 20, 2017 · 1 comment
Labels
domain: build The build does not work as the Arduino IDE. importance: no user impact OS: all status: fixed in 4.1 status: workaround documented A workaround has been confirmed to solve this issue.

Comments

@jantje
Copy link
Member

jantje commented Mar 20, 2017

Any empty method declared with {} in a .ino file will generated a redefinition error.
The root cause is that the ino to cpp converter expects at least 1 character between '{' and '}'
The work around is to use
void loop(){ }

@jantje jantje added domain: build The build does not work as the Arduino IDE. importance: no user impact OS: all status: workaround documented A workaround has been confirmed to solve this issue. labels Mar 20, 2017
@jantje
Copy link
Member Author

jantje commented Mar 20, 2017

FYI
I could never notice this issue as I use the formatter
afbeelding

and have CDT format the files on each save.

afbeelding

I had to turn these off to reproduce the issue.

jantje pushed a commit that referenced this issue Apr 1, 2017
@jantje jantje closed this as completed May 25, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain: build The build does not work as the Arduino IDE. importance: no user impact OS: all status: fixed in 4.1 status: workaround documented A workaround has been confirmed to solve this issue.
Projects
None yet
Development

No branches or pull requests

1 participant