can't locate avr libraries

Hello,

I have been trying to setup Arduino 0017 on an Ubunut 9.10, after having upgraded from 8.04 and so forth. I followed all setup instructions for the IDE and it starts. When trying to compile an example the IDE complains about not being able to find the avr/io.h and other inlcudes.

I assume that some paths are not known to the compiler. In theory though the avr-gcc should know where avr-libc reside. Does anyone have a clue ? where do I modify the paths ?

thx

s

to illustrate this, see the error messages for teh Blink sketch:

/home/reinhard/arduino-0017/hardware/cores/arduino/wiring_private.h:28:20: error: avr/io.h: No such file or directory

/home/reinhard/arduino-0017/hardware/cores/arduino/wiring_private.h:29:27: error: avr/interrupt.h: No such file or directory

/home/reinhard/arduino-0017/hardware/cores/arduino/wiring_private.h:30:23: error: avr/delay.h: No such file or directory

/home/reinhard/arduino-0017/hardware/cores/arduino/wiring_private.h:31:19: error: stdio.h: No such file or directory

                 from /home/reinhard/arduino-0017/hardware/cores/arduino/wiring.c:25:

/home/reinhard/arduino-0017/hardware/cores/arduino/wiring.h:101: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'boolean'

/home/reinhard/arduino-0017/hardware/cores/arduino/wiring.h:102: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'byte'

/home/reinhard/arduino-0017/hardware/cores/arduino/wiring.h:110: error: expected ')' before 'mode'

/home/reinhard/arduino-0017/hardware/cores/arduino/wiring.h:111: error: expected ')' before 'int'

/home/reinhard/arduino-0017/hardware/cores/arduino/wiring.h:123: error: expected ')' before 'pin'

/home/reinhard/arduino-0017/hardware/cores/arduino/wiring.h:125: error: expected ')' before 'dataPin'

/home/reinhard/arduino-0017/hardware/cores/arduino/wiring.h:127: error: expected ')' before 'void'

/home/reinhard/arduino-0017/hardware/cores/arduino/wiring.c: In function 'millis':

/home/reinhard/arduino-0017/hardware/cores/arduino/wiring.c:66: error: 'uint8_t' undeclared (first use in this function)

/home/reinhard/arduino-0017/hardware/cores/arduino/wiring.c:66: error: (Each undeclared identifier is reported only once

/home/reinhard/arduino-0017/hardware/cores/arduino/wiring.c:66: error: for each function it appears in.)

/home/reinhard/arduino-0017/hardware/cores/arduino/wiring.c:66: error: expected ';' before 'oldSREG'

/home/reinhard/arduino-0017/hardware/cores/arduino/wiring.c:72: error: 'SREG' undeclared (first use in this function)

/home/reinhard/arduino-0017/hardware/cores/arduino/wiring.c:72: error: 'oldSREG' undeclared (first use in this function)

/home/reinhard/arduino-0017/hardware/cores/arduino/wiring.c: In function 'micros':

/home/reinhard/arduino-0017/hardware/cores/arduino/wiring.c:79: error: 'uint8_t' undeclared (first use in this function)

/home/reinhard/arduino-0017/hardware/cores/arduino/wiring.c:79: error: expected ';' before 'oldSREG'

/home/reinhard/arduino-0017/hardware/cores/arduino/wiring.c:82: error: 'TCNT0' undeclared (first use in this function)

/home/reinhard/arduino-0017/hardware/cores/arduino/wiring.c:88: error: 'TIFR' undeclared (first use in this function)

/home/reinhard/arduino-0017/hardware/cores/arduino/wiring.c:88: error: 'TOV0' undeclared (first use in this function)

/home/reinhard/arduino-0017/hardware/cores/arduino/wiring.c:93: error: 'SREG' undeclared (first use in this function)

/home/reinhard/arduino-0017/hardware/cores/arduino/wiring.c:93: error: 'oldSREG' undeclared (first use in this function)

/home/reinhard/arduino-0017/hardware/cores/arduino/wiring.c: In function 'delayMicroseconds':

/home/reinhard/arduino-0017/hardware/cores/arduino/wiring.c:111: error: 'uint8_t' undeclared (first use in this function)

/home/reinhard/arduino-0017/hardware/cores/arduino/wiring.c:111: error: expected ';' before 'oldSREG'

/home/reinhard/arduino-0017/hardware/cores/arduino/wiring.c:155: error: 'oldSREG' undeclared (first use in this function)

/home/reinhard/arduino-0017/hardware/cores/arduino/wiring.c:155: error: 'SREG' undeclared (first use in this function)

/home/reinhard/arduino-0017/hardware/cores/arduino/wiring.c: In function 'init':

/home/reinhard/arduino-0017/hardware/cores/arduino/wiring.c:178: error: 'TCCR0A' undeclared (first use in this function)

/home/reinhard/arduino-0017/hardware/cores/arduino/wiring.c:178: error: 'WGM01' undeclared (first use in this function)

/home/reinhard/arduino-0017/hardware/cores/arduino/wiring.c:178: error: lvalue required as left operand of assignment

/home/reinhard/arduino-0017/hardware/cores/arduino/wiring.c:179: error: 'WGM00' undeclared (first use in this function)

/home/reinhard/arduino-0017/hardware/cores/arduino/wiring.c:179: error: lvalue required as left operand of assignment

/home/reinhard/arduino-0017/hardware/cores/arduino/wiring.c:186: error: 'TCCR0B' undeclared (first use in this function)

/home/reinhard/arduino-0017/hardware/cores/arduino/wiring.c:186: error: 'CS01' undeclared (first use in this function)

/home/reinhard/arduino-0017/hardware/cores/arduino/wiring.c:186: error: lvalue required as left operand of assignment

/home/reinhard/arduino-0017/hardware/cores/arduino/wiring.c:187: error: 'CS00' undeclared (first use in this function)

/home/reinhard/arduino-0017/hardware/cores/arduino/wiring.c:187: error: lvalue required as left operand of assignment

/home/reinhard/arduino-0017/hardware/cores/arduino/wiring.c:193: error: 'TIMSK0' undeclared (first use in this function)

/home/reinhard/arduino-0017/hardware/cores/arduino/wiring.c:193: error: 'TOIE0' undeclared (first use in this function)

/home/reinhard/arduino-0017/hardware/cores/arduino/wiring.c:193: error: lvalue required as left operand of assignment

/home/reinhard/arduino-0017/hardware/cores/arduino/wiring.c:202: error: 'TCCR1B' undeclared (first use in this function)

/home/reinhard/arduino-0017/hardware/cores/arduino/wiring.c:202: error: 'CS11' undeclared (first use in this function)

/home/reinhard/arduino-0017/hardware/cores/arduino/wiring.c:202: error: lvalue required as left operand of assignment

/home/reinhard/arduino-0017/hardware/cores/arduino/wiring.c:203: error: 'CS10' undeclared (first use in this function)

/home/reinhard/arduino-0017/hardware/cores/arduino/wiring.c:203: error: lvalue required as left operand of assignment

/home/reinhard/arduino-0017/hardware/cores/arduino/wiring.c:205: error: 'TCCR1A' undeclared (first use in this function)

/home/reinhard/arduino-0017/hardware/cores/arduino/wiring.c:205: error: 'WGM10' undeclared (first use in this function)

/home/reinhard/arduino-0017/hardware/cores/arduino/wiring.c:205: error: lvalue required as left operand of assignment

/home/reinhard/arduino-0017/hardware/cores/arduino/wiring.c:211: error: 'TCCR2B' undeclared (first use in this function)

/home/reinhard/arduino-0017/hardware/cores/arduino/wiring.c:211: error: 'CS22' undeclared (first use in this function)

/home/reinhard/arduino-0017/hardware/cores/arduino/wiring.c:211: error: lvalue required as left operand of assignment

/home/reinhard/arduino-0017/hardware/cores/arduino/wiring.c:217: error: 'TCCR2A' undeclared (first use in this function)

/home/reinhard/arduino-0017/hardware/cores/arduino/wiring.c:217: error: 'WGM20' undeclared (first use in this function)

/home/reinhard/arduino-0017/hardware/cores/arduino/wiring.c:217: error: lvalue required as left operand of assignment

/home/reinhard/arduino-0017/hardware/cores/arduino/wiring.c:235: error: 'ADCSRA' undeclared (first use in this function)

/home/reinhard/arduino-0017/hardware/cores/arduino/wiring.c:235: error: 'ADPS2' undeclared (first use in this function)

/home/reinhard/arduino-0017/hardware/cores/arduino/wiring.c:235: error: lvalue required as left operand of assignment

/home/reinhard/arduino-0017/hardware/cores/arduino/wiring.c:236: error: 'ADPS1' undeclared (first use in this function)

/home/reinhard/arduino-0017/hardware/cores/arduino/wiring.c:236: error: lvalue required as left operand of assignment

/home/reinhard/arduino-0017/hardware/cores/arduino/wiring.c:237: error: 'ADPS0' undeclared (first use in this function)

/home/reinhard/arduino-0017/hardware/cores/arduino/wiring.c:237: error: lvalue required as left operand of assignment

/home/reinhard/arduino-0017/hardware/cores/arduino/wiring.c:240: error: 'ADEN' undeclared (first use in this function)

/home/reinhard/arduino-0017/hardware/cores/arduino/wiring.c:240: error: lvalue required as left operand of assignment

/home/reinhard/arduino-0017/hardware/cores/arduino/wiring.c:248: error: 'UCSR0B' undeclared (first use in this function)

it is really quite hard for me to understand what is happening, as 0016 worked fine on ubuntu 8.04. then i started upgrading ...

What if you trying running avr-gcc from the command line on a file that has just #include <avr/.io.h> in it?

seems my suspicion proved right:

test.c:1:20: error: avr/io.h: No such file or directory

so not really an Arduino problem it seems, rather a Ubuntu avr-gcc issue.

s

You have to install the "avr-libc" package for ubuntu (any linux-distro in fact). Eberhard

did that,

error persisted

then purged both avr-gcc & avr-libc, and reinstalled both,

same error.

I am really at a loss.

s

Are the libc-files in place? The Ubtuntu 9.10 location for the avr related includes is : /usr/lib/avr/.....

Which version does avr-gcc report? Eberhard

thx, this it what puzzles me:

avr-gcc is version 4.3.3

ls in /usr/lib/avr gives
bin include lib

particularly in include i find the stdio.h and oher includes (e.g. avr/io.h), which apparently are missing.

seems that avr-gcc does not have the right path to these.

any idea ?

s

p.s. best regards to wuppertal.

I don't have a clue .... Running avr-gcc with argument -v gives some more info.

avr-gcc -v
Es werden eingebaute Spezifikationen verwendet.
Ziel: avr
Konfiguriert mit: ../src/configure -v --enable-languages=c,c++ --prefix=/usr/lib --infodir=/usr/share/info --mandir=/usr/share/man --bindir=/usr/bin --libexecdir=/usr/lib --libdir=/usr/lib --enable-shared --with-system-zlib --enable-long-long --enable-nls --without-included-gettext --disable-checking --disable-libssp --build=i486-linux-gnu --host=i486-linux-gnu --target=avr
Thread-Modell: single
gcc-Version 4.3.3 (GCC)

Output is in german, but could you compare this to the prefix/libdir entries on your machine? Eberhard

thanks,

no problem on the german, I was born in wuppertal.

so i ran avr-gcc -v and it showed (amongst others)

--prefix=/usr/local

while the libraries as shown above reside in /usr/lib

as a quick & dirty solution i cd ed into /usr/local and

ln -s /usr/lib/avr avr

thereafter the arduino IDE properly compiled the sample files.

however, i still do not understand why avr-gcc does not configure with the proper pathnames. maybe this is related to the update history from 8.04 ? but redefining the pathnames would clearly be the more aesthetic solution.

in any case, thanks for the valuable support

s