[SOLVED ?] error : 'prog_uint8_t' does not name a type

Hi all !

First post in the forum ! Youhou !

While trying to build avril-examples (mcp4921) I get the following error: ./avrlib/op.h:514:11: error: ‘prog_uint8_t’ does not name a type
After some digging it seems like “prog_uint8_t” is deprecated in the latest avr distrib :

\\ingroup avr_pgmspace
\\typedef prog_uint8_t

This typedef is now deprecated because the usage of the progmem
attribute on a type is not supported in GCC. However, the use of the
progmem attribute on a variable declaration is supported, and this is
now the recommended usage.

The typedef is only visible if the macro PROG_TYPES_COMPAT
has been defined before including <avr/pgmspace.h> (either by a
#define directive, or by a -D compiler option.)

Type of an “uint8_t” object located in flash ROM.

typedef uint8_t PROGMEM prog_uint8_t;

Replacing “prog_uint8_t” by “uint8_t” let me pass the error :wink:

Hope it helps !

I had the same errors when using CrossPack 2012 SDK. They deprecate some types (and maybe some APIs also). Using 2010 version works without errors.

Hum … looking at the avr doc it seems that this typedef is only visible if PROG_TYPES_COMPAT has been defined.
Adding #define PROG_TYPES_COMPAT just before #include <avr/pgmspace.h> does the trick …
(ie : http://www.nongnu.org/avr-libc/user-manual/group_avr_pgmspace.html#ga39235a28487ae7790ce5f4c8178c8ed7)

So far I revert my changes. I kept “prog_uint8_t” but have added the macro before the include statement …
All avril-example compiles. I also did the same modification in the shruti-1/shruti and shruti/avrlib folder and so far, everything compiles ! (Unfortunatly, hardware is not yet reading for testing :frowning: ).

Having recently switched to a linux build machine with the latest gcc, I had actually made the fix to the makefile in avril but some projects have not been updated yet with the latest version of avril.