osx-cross / homebrew-avr

Homebrew AVR Toolchain
BSD 2-Clause "Simplified" License
393 stars 79 forks source link

avr-gcc 7.1.0 will not find <avr/io.h> #55

Closed ubidefeo closed 7 years ago

ubidefeo commented 7 years ago

just updated but had to brew switch avr-gcc 6.3.0 to have my code compile again.

Compiling C: main.c
avr-gcc -c -mmcu=atmega8515 -I. -gdwarf-2  -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-adhlns=./main.lst  -std=gnu99 -MMD -MP -MF .dep/main.o.d main.c -o main.o
main.c:34:10: fatal error: avr/io.h: No such file or directory
 #include <avr/io.h>
          ^~~~~~~~~~
compilation terminated.
make: *** [main.o] Error 1
ddavidebor commented 7 years ago

same issue here with gcc 7, on a project that compiles correctly on Arch with the same avr-gcc version

ladislas commented 7 years ago

you need to recompile avrlibc for each avr version.

this is fixed in branch https://github.com/osx-cross/homebrew-avr/tree/update-7.1-6.4

will merge soon to master

codmpm commented 7 years ago

Having the problem right now. How can I use the update-7.1-6.4 version?

ladislas commented 7 years ago

@codmpm navigate to /usr/local/Homebrew/Library/Taps/osx-cross/homebrew-avr/ and switch branch

codmpm commented 7 years ago

Thank you!

But sadly I only have a master branch: bildschirmfoto 2017-08-04 um 11 14 30

ladislas commented 7 years ago

@codmpm i just merge the changes, brew update should pull them and it should work. if not untap and tap again ;)

and as for only seeing the master branch, I had the same issue, you need to:

git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"

fixed it for me :)

codmpm commented 7 years ago

That did the trick - thank you!

bildschirmfoto 2017-08-04 um 11 22 50

codmpm commented 7 years ago

Sorry to bother you again... but I think I've messed something up:

bildschirmfoto 2017-08-04 um 11 27 24

ladislas commented 7 years ago

oh sorry! I have to update the readme. You just need to run brew install avr-gcc :)

ladislas commented 7 years ago

but as said, it is now merged in master, so no need to switch branches.

codmpm commented 7 years ago

It is working from master. Thank you so much!