Compiler cannot find pgmspace.h

I'm brand-new to the Arduino and I'm trying to use PROGMEM to store some strings. All of the examples say that I should include "avr/pgmspace.h" however the program refuses to compile. I searched all over for it and found that several folders deep in a different directory. Basically when I unzipped the Windows package it created a folder called "Arduino 1.0" and it contains a subfolder "libraries" that contains all of the standard libraries. There is also "Arduino 1.0/hardware/tools/avr/avr/include/avr/pgmspace.h" which is the only copy of the include file that I can find.

Without going through a bunch of trial and error can someone tell me which of these deeply nested folders I need to copy to "Arduino 1.0/libraries" in order to get my program to compile. Is there something more beyond the "pgmspace.h" file that needs to be copied. Is there a something.cpp as well that I need?

You don't need to include that file. Arduino IDE with do that automatically. So delete the line with pgmspace.h

You can place strings in program space with F(). Like this: Serial.println(F("Hello, this string is in program space")); There is also an sprintf_P, which also places the string in program space.

Thanks for the heads-up on the F() option. I'm actually creating an array of strings so I imagine I still have to do that long way using PROGMEM modifiers and an array of pointers?

By the way where in the documentation would I have found that F() feature?

Also when you said that AVR library is automatically included does that mean everything listed in this reference?

Unrelated question while I'm at it… Does the compiler support macros just like regular C/C++ does. The language reference only talks about

define Variable Value

Does the compiler support macros just like regular C/C++ does.

Why wouldn’t it? It IS a regular C++ compiler.

Documentation for the F() macro ? I can't find it!

Normally everything is included. But with libraries you need to include some files, and sometimes also with normal sketches, some library include files are needed.

The gcc C/C++ compiler does support macros. It is the full gcc compiler. For macro's see this:

Not everything is included. Search Arduino.h in your computer and see what are included by default.

Documentation for the F() macro ? I can't find it!

Its mentioned in the 1.0 release notes.

  • Support has been added for printing strings stored in flash (program memory) rather than RAM. Wrap double-quoted strings in F() to indicate that they should be stored in flash, e.g. Serial.print(F("hello world")).