Home Forums Sparkfun MP3 Shield Library Support Forum compile error: variable ‘bitrate_table’ must be const Reply To: compile error: variable ‘bitrate_table’ must be const


I am not 100%, but I believe your problem is the version of avr-gcc. My google foo finds this issue with newer versions of avr-gcc, than I think what is found in the Arduino IDE.  I am running windows with 1.0.3 and likewise did not have problems with 1.0.1. or 1.0.2. Which uses avr-gcc 4.3.2 It looks like at least 4.7.0 and greater may have this issue.

Try replacing the line SFEMP3Shield.cpp:25 with

– PROGMEM uint16_t bitrate_table[15][6] = {
+ static const uint16_t bitrate_table[15][6] PROGMEM = {

Also does a “which avr-gcc” show you are using an instance outside that of the Arduino’s IDE?

what is the version of “avr-gcc -v”? (both, if other) to confirm this was the problem.

If the above fixes the issue I can check it in. As it appears to work fine on my version with the proposed change.

Reference: http://code.google.com/p/sdfatlib/issues/detail?id=39