small medium large xlarge

Back to: All Forums  Arduino
04 Jan 2012, 16:28
Henri Blumenstiel (1 post)

Hi Maik, first of all thank’s a lot for your very useful book ‘Arduino’. Now I’m looking forward to write my code a little bit more methodically! The Telegraph example works well when I use the Arduino 0022 release but with the last one the following error message occurs: core.a(main.cpp.o): In function main': /Applications/ undefined reference to setup’ /Applications/ undefined reference to `loop’ Before compilation I replaced WProgram.h with Arduino.h as you recommended. In the main.cpp the Arduino.h file is included too and in the Arduino.h, setup() and loop() are declared. What’s going wrong ? Kind regards, Henri

04 Jan 2012, 17:25
Maik Schmidt (122 posts)

Hi Henri!

I see the same error message when I compile the Telegraph.pde sketch directly. I do not know why that happens and I’ll have a look at it.

But it’s not a big problem, because when you copy the Telegraph files to Arduino’s libraries folder (as described in the book) then everything works fine.

Because of the stricter warning level of Arduino 1.0 you’ll see a couple of warnings. You can eliminate most of them by replacing @char* LETTERS@ and @char* DIGITS@ with @const char* LETTERS@ and @const char* LETTERS@. Also you have to use unsigned values for loop counters, that is, use @for (unsigned int i …@ instead of @for (int i …@.



You must be logged in to comment