Go Down

Topic: error compiling on gcc-avr 4.6.1 (Read 17446 times) previous topic - next topic

albinou

For those of you who don't have the gcc-avr-4.6.0-3 package anymore, you still can download it here :

http://schlunix.org/archlinux/pool/community/gcc-avr-4.6.0-3-i686.pkg.tar.xz
or
http://schlunix.org/archlinux/pool/community/gcc-avr-4.6.0-3-x86_64.pkg.tar.xz

And thanks for your patch, ygrek. It seems to work fine ;)

EvolveElectronics

Just want to let you know that using  the following command in fedora15 i was able to get the Arduino IDE to compile again.

Code: [Select]
sudo yum downgrade avr-gcc avr-gcc-c++

Kojans

Hi,

had the same issue here with gcc-avr-4.6.1 on Arch Linux. But today I could update to gcc-avr-4.6.2-1; and that solved it.

I have same problem!

Code: [Select]

const char num1[] PROGMEM = "09194986646", num2[] PROGMEM = "44166762";
char* num[]  PROGMEM = {(void *)num1, (void *)num2};


It works fine when compiling with WINAVR2010 but compiling
Code: [Select]

const char num1[] PROGMEM = "09194986646", num2[] PROGMEM = "44166762";
PGM_P num[]  PROGMEM = {(void *)num1, (void *)num2};

with gcc version 4.6.2 (AVR_8_bit_GNU_Toolchain_3.4.1_798) the compiler returns this error:
Code: [Select]

monitoring.c:10:7: error: variable 'num' must be const in order to be put into read-only section by means of '__attribute__((progmem))'


Have anybody solved this ptoblem?

K5CZ

Two years ago, and I have same problem:
Using older versions of Arduino IDE is OK, but latest betas 1.5.6 , 1.5.7 and 1.5.8 produces same error:

error: variable Text'Info' must be const in order to be put into read-only section by means of '__attribute__((progmem))'

My program contains:
char TextInfo [] PROGMEM = "some text";

Changing to
const TextInfo [] PROGMEM = "some text";

causes another error:
error: 'TextInfo' does not name a type

Please, I am beginner and I do not uderstand all of C++ nuances, can you help me to solve this problem?
Arduino Uno R3, Arduino Mega 2560 R3, Ethermega (R3), and some Ethernet Shields (R3), Chronodots, TMP36 sensors, DS18B20 sensors, LCDs/TFTs, RS232C to learn and play...

AdaptTech

I'm also having the same problem.  Could anyone please lend a hand?

I'm using Ubuntu 14.04 LTS and Arduino IDE 1.0.5

By using the Time library I get

Quote

/home/adapttech/sketchbook/libraries/Time/DateStrings.cpp:11:0:
/home/adapttech/sketchbook/libraries/Time/DateStrings.cpp:41:22: error: variable 'monthNames_P' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
PGM_P monthNames_P[] PROGMEM =

tf68

Do just what the error message says and declare 'monthNames_P' a constant.

PGM_P const monthNames_P[] PROGMEM =

AdaptTech

I already did, but now I get different error messages:

Quote

/home/adapttech/sketchbook/libraries/Time/DateStrings.cpp: In function 'const char* monthStr(uint8_t)':
/home/adapttech/sketchbook/libraries/Time/DateStrings.cpp:63:35: error: new declaration 'const char* monthStr(uint8_t)'
const char* monthStr(uint8_t month)
                                   ^
In file included from /home/adapttech/sketchbook/libraries/Time/DateStrings.cpp:21:0:
/home/adapttech/sketchbook/libraries/Time/Time.h:127:7: error: ambiguates old declaration 'char* monthStr(uint8_t)'
char* monthStr(uint8_t month);
       ^
/home/adapttech/sketchbook/libraries/Time/DateStrings.cpp: In function 'const char* monthShortStr(uint8_t)':
/home/adapttech/sketchbook/libraries/Time/DateStrings.cpp:69:40: error: new declaration 'const char* monthShortStr(uint8_t)'
const char* monthShortStr(uint8_t month)
                                        ^
In file included from /home/adapttech/sketchbook/libraries/Time/DateStrings.cpp:21:0:
/home/adapttech/sketchbook/libraries/Time/Time.h:129:7: error: ambiguates old declaration 'char* monthShortStr(uint8_t)'
char* monthShortStr(uint8_t month);
       ^
/home/adapttech/sketchbook/libraries/Time/DateStrings.cpp: In function 'const char* dayStr(uint8_t)':
/home/adapttech/sketchbook/libraries/Time/DateStrings.cpp:77:31: error: new declaration 'const char* dayStr(uint8_t)'
const char* dayStr(uint8_t day)
                               ^
In file included from /home/adapttech/sketchbook/libraries/Time/DateStrings.cpp:21:0:
/home/adapttech/sketchbook/libraries/Time/Time.h:128:7: error: ambiguates old declaration 'char* dayStr(uint8_t)'
char* dayStr(uint8_t day);
       ^
/home/adapttech/sketchbook/libraries/Time/DateStrings.cpp: In function 'const char* dayShortStr(uint8_t)':
/home/adapttech/sketchbook/libraries/Time/DateStrings.cpp:83:36: error: new declaration 'const char* dayShortStr(uint8_t)'
const char* dayShortStr(uint8_t day)
                                    ^
In file included from /home/adapttech/sketchbook/libraries/Time/DateStrings.cpp:21:0:
/home/adapttech/sketchbook/libraries/Time/Time.h:130:7: error: ambiguates old declaration 'char* dayShortStr(uint8_t)'
char* dayShortStr(uint8_t day);

lesto

yout "Time" library is broken.

it is non official, so just delete it, it is here:

/home/adapttech/sketchbook/libraries/Time/

and look if you have a new version. You may fix it, the problem SEEMS that function declaration is const char* but function implementation use char*.
sei nuovo? non sai da dove partire? leggi qui: http://playground.arduino.cc/Italiano/Newbie

AdaptTech

Hello Iesto,

You were right, I was using an older version that didn't implement everything correctly.  The latest one can be found here: https://github.com/PaulStoffregen/Time

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!

Arduino
via Egeo 16
Torino, 10131
Italy