small medium large xlarge

Back to: All Forums  Arduino
13 Feb 2012, 23:56
Peter Hoyt (2 posts)

Hi there,

This is my first posting to this forum.

I’ve been trying to get the telegraph example to compile but I keep running into a different error than Henri reported. I typed all the code in just as the book instructs… but kept seeing an error in the telegraph.cpp file. Then I downloaded the code from this site and tried again and got the same error. In the Telegraph constructor, the line “pinMode(_output_pin, OUTPUT);” throws an error in the Arduino 1.0 IDE that says “ ‘OUTPUT’ was not declared in this scope”

I’m not a C++ developer, but I do use a lot of higher level scripting languages. I understand the concept of scope, but I don’t see the problem in this environment. I’m using the latest Arduino IDE on a new Win7, 64 bit computer.

Any thoughts?

Thanks, Peter

14 Feb 2012, 07:07
Maik Schmidt (122 posts)

Hi Peter!

In Arduino 1.0 the header file WProgram.h has been renamed to Arduino.h. So use @#include @ instead of @#include @.



17 Feb 2012, 04:29
Peter Hoyt (2 posts)

Hi there! Thanks for the reply. That eliminated the error I was seeing. However, now I’m seeing a new error when I try to compile the program the main.cpp throws an error in ‘main’:

C:\arduino-1\hardware\arduino\cores\arduino/main.cpp:11: undefinded reference to ‘setup’

and again at: C:\arduino-1\hardware\arduino\cores\arduino/main.cpp:14: undefinded reference to ‘loop’

This sounds like I’m doing something seriously wrong, yet this is the copy of the code I downloaded, just with the header edit you suggested.

Any thoughts? Thanks, Pete

17 Feb 2012, 07:07
Maik Schmidt (122 posts)

Hi Pete!

The Telegraph project is a library, not a real sketch, so I guess the problem is that you’re trying to compile the library and the sketch directly. Instead you have to copy the project (including the examples, but excluding the Telegraph.pde file) to the Arduino’s library folder as described in the book’s text. After a restart of the IDE it will be compiled automatically. Then you can load the examples from the IDE’s “Open Examples” dialog.

Cheers, Maik

You must be logged in to comment