Go Down

Topic: "was not declated in this scope" error on Blink, newbie stuck - help please (Read 1 time) previous topic - next topic


Hi there, I'm afraid its another silly newbie problem I'm looking for some help with please.
I received my new Arduino Duemilanove ATmega 328 p & followed the setup as per instruction on this site after downloading the Windows software ( Arduino 0022, I'm running it on XP Professional Sp3 ).
Drivers installed no problem.
It automatically set up the serial USB onto port 11, so as in instructions I changed this to a lower port (port 1).

After selecting the correct board & port in tools tab of the software then loading "Blink" from File, sketchbook, basics - my problem is this...

If I try & upload to the board or if I run the sketch, some error messages appear.

The board has a blue power led on and a yellow "L" led constantly flickering as soon as usb is connected - this does not change whilst attempting to upload ie no Rx/Tx led's.

The error shown is cut & pasted as follows:-

Blink.cpp:8:22: error: WProgram.h: No such file or directory
Blink.cpp: In function 'void setup()':
Blink:10: error: 'OUTPUT' was not declared in this scope
Blink:10: error: 'pinMode' was not declared in this scope
Blink.cpp: In function 'void loop()':
Blink:14: error: 'HIGH' was not declared in this scope
Blink:14: error: 'digitalWrite' was not declared in this scope
Blink:15: error: 'delay' was not declared in this scope
Blink:16: error: 'LOW' was not declared in this scope

Also tried this on my laptop (XP Sp3) with same results.

Any help here would be greatly appreciated.

Kind regards, Matthew

James C4S

It would be helpful if you posted the code you are trying to compile.  (Just saying "I was using the example" can be misleading.  You'd be surprised what small things can mess the process up.)

When posting code, please use the code brackets or the "#" button in the post editor.
Capacitor Expert By Day, Enginerd by night.  ||  Personal Blog: www.baldengineer.com  || Electronics Tutorials for Beginners:  www.addohms.com


"WProgram.h" you probably need to copy this file into your local arduino storage area.
The rest sounds like missing ; or) or } somewhere.
Really need to see your code listing as James said.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.


This sounds to me like an error in downloading/extracting.

I presume you downloaded, extracted and then copied the whole folder somewhere then when running the software encountered this error.

What extractor did you use?


Thankyou all for your help.
You have hit the nail on the head, problem solved!

As I am unable to get an internet connection at home on my pc, I downloaded the zip file on my Android smartpone.
Somehow some files have gone missing when extracting.

I have extracted from the zip file again and hey-presto it worked straight away!

Just need to find a practical use for this board now.

Sorry to trouble you guys with this problem, I'm very grateful for your help.



Sorry to trouble you guys with this problem, I'm very grateful for your help.

No worries, the problem comes up now and again - thankfully it is normally an easy one to solve.

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131