Welcome! Log In Create A New Profile


compile error with arduino 0018

Posted by jmgiacalone 

I am part way through assembling my Mendel and decided to test one of my stepper motors today.

I managed to upload a test program (starwars theme) to my Arduino Mega, and the stepper test was successful. Encouraged by my success I thought I would upload the 5D_GCode firmware, but fell at the first hurdle.

I am using Arduino IDE 0018 on Ubuntu Lucid and keep getting the following compile error:

error: expected ‘,’ or ‘...’ before ‘&’ tokenBad error line: -21

I have tried compiling the standard reprap code (reprap-mendel-20100308 from sourceforge) as well as forks from Joaz and tonokip, and I still get the same error.

Has anyone seen this before? Or can anyone shed any light on what the error might mean? Commenting out any lines which include the '&' symbol has no effect.

I'm wondering if my Arduino installation is corrupt, although the test program compiled and uploaded successfully?!

I'd be really grateful if someone could help me out as I din't much fancy the idea of commenting out every line until I find the cause!

Well I have found a temporary fix.

Having downloaded version 0017 of the Arduino IDE, the code now compiles.

It would be nice to know why the code does not compile in version 0018, but at least for now I can continue my machine build.
Re: compile error with arduino 0018
June 04, 2010 10:18PM
I can confirm this issue, and I seem to have found a solution.

There appears to be a bug in arduino 0018 that basically means the comments at the top of the main FiveD_GCode_Interpreter.pde file confuse whatever behind-the-scenes transformation of the C++ code it does. It ends up trying to forward declare functions with parameter types that are defined in vector.h, before #including vector.h, which isn't ever going to work.

Having got that far, the fix/workaround seems to be weirdly simple: Move the #include statements above the comments!

I don't have time to chase down an Arduino IDE bug right now, so I'll probably just commit this small change to the reprap.org svn instead.

Attached is a diff that works for me. Let me know if it works for you too smiling smiley

open | download - arduino0018workaround.diff (936 bytes)
Hi Jonathan,

Well the bug was present in the version of the Arduino IDE I installed as a Ubuntu package (had to add source info etc before installing). I tried just downloading the 0018 IDE and running the program directly form inside the folder (as that was how I was running 0017), and everything works as expected. I guess the Ubuntu package must have differences to the main IDE release.
Sorry, only registered users may post in this forum.

Click here to login