johngarchie / xmas-icetube

Alternative Ice Tube Clock firmware and hardware revision
43 stars 15 forks source link

Compiler error with gcc 4.3.2 #2

Closed jscrane closed 10 years ago

jscrane commented 10 years ago

I get this error with avr-gcc version 4.3.2. My OS is Linux Mint, Debian Edition, which doesn't seem to have an avr-gcc package. I used the one from the Arduino-1.0.5 distribution.

Any ideas?

$ make avr-gcc -c -I. -mmcu=atmega328p -std=gnu99 -Os -Wall -DF_CPU=8000000 -o system.o system.c system.c: In function ‘system_init’: system.c:49: error: ‘PB4’ undeclared (first use in this function) system.c:49: error: (Each undeclared identifier is reported only once system.c:49: error: for each function it appears in.) system.c:56: error: ‘PC2’ undeclared (first use in this function) system.c: In function ‘system_sleep_loop’: system.c:134: warning: implicit declaration of function ‘sleep_bod_disable’ make: *\ [system.o] Error 1

johngarchie commented 10 years ago

It looks like the libraries included with Arduino's avr-gcc are broken. Although I'm currently on a mac, I was able to replicate the error using the version of GCC (also 4.3.2) that was included with my Arduino distribution. The xmas-icetube code uses the avr-gcc header file "avr/io.h" which should define man macros such as "PB4", but that isn't happening. And I did confirm I did confirm that the Arduino gcc include files were broken by looking at the source code. You'll need to use an avr-gcc package that isn't broken.

On the Linux Mint Software Portal there were some packages that looked promising: "gcc-avr", "avr-libc", "binutils-avr", and "avrdude". But maybe you've seen at those already?

Anyway, let me know how things work out. Good luck!

jscrane commented 10 years ago

Hi John, after installing the packages you mentioned, it builds fine! Thanks for your help!

johngarchie commented 10 years ago

Excellent! You're very welcome. Although I cannot fix Arduino's avr-gcc, it's helpful for me to know about the issue. So thank you for bringing it to my attention!