Skip to content

1.6 Frequently Asked Questions

nixiebunny edited this page Jan 31, 2016 · 12 revisions

Q: I've upgraded from IDE 1.0.x to 1.6.x and all my sketches and libraries are gone!

A: IDE 1.6.x changes the location of the preferences file.

Therefore, it's using the default sketchbook location, which is C:\Users\username\Documents\Arduino on Windows, /Users/username/Documents/Arduino on MacOSX and /home/username/Arduino on GNU/Linux.

Change the IDE preferences to use the same sketchbook folder IDE 1.0.x was using.

Errors related to AVR PROGMEM changes

Q: I get an error message that says: variable 'message' must be const in order to be put into read-only section by means of '__attribute__((progmem))': char message[] PROGMEM = "Hello!";. What can I do?

A: The latest avr-gcc compiler (used by Arduino 1.6.x) requires that variables in PROGMEM to be declared as const.

First of all check if an updated version of the libraries used in the sketch has been released. Upgrading libraries is far the best way to solve the problem.

If there are no alternatives you can go to the hard path and change the declaration in your sketch or in your library from

char message[] PROGMEM = "Hello!";

to

const char message[] PROGMEM = "Hello!";

Q: I have a similar error but it seems to be already const! Here's the error: variable 'lotOfMessages' must be const in order to be put into read-only section by means of '__attribute__((progmem))': const char* lotOfMessages[] PROGMEM = {

A: In this case you have an array of messages (not just one) and you must tell the compiler that each one of them is const. Here how is it done, change:

const char* lotOfMessages[] PROGMEM = {

to

const char * const lotOfMessages[] PROGMEM = {

And, yes, it's really tricky even for experts.

Q: The compiler complains about prog_char (or anything that begins with prog_...). The exact error is: ISO C++ forbids declaration of 'type name' with no type. What can I do?

A: The new avr-libc (used in Arduino 1.6.x) has deprecated the use of prog_char. You must replace every occurrence of prog_... with the corresponding C/C++ plain type. Here's a quick reference table:

replace... ...with...
prog_char char
prog_uchar unsigned char
prog_int8_t int8_t
prog_uint8_t uint8_t
prog_int16_t int16_t
prog_uint16_t uint16_t
prog_int32_t int32_t
prog_uint32_t uint32_t
prog_int64_t int64_t
prog_uint64_t uint64_t