Reputation: 11
im trying to solve this issue for a few days now and i cant find any solution. I got myself an Atmega88A and i want to program it on fedora. I tried to program C with gcc and that went well. But as i tried to include the avr/io.h, i always get the failure that it didnt found anything. I tried to get the new version of gcc, but that gives me an error too. Would it be enough to just download the avr/io.h library and implement it somewhere in my files? or is there any way to download this all together, including also all the other libraries that i need (e.g. util/delay.h)
Upvotes: 1
Views: 2541
Reputation: 87426
You need to use a version of GCC that is specifically built to target AVR chips, you cannot just use the normal gcc
executable for your system because it will produce the wrong kind of program. If you download a correctly-configured toolchain, then lines like #include <avr/io.h>
should work automatically because the toolchain's default include search paths will be set up properly.
Many Linux distributions provide an avr-gcc
package that you can just install with your package manager, including Fedora. You might have to install the avr-libc
package to get the avr/io.h
header.
If that doesn't work for some reason, you could try downloading Microchip's official AVR toolchain from this page:
http://www.microchip.com/avr-support/avr-and-arm-toolchains-(c-compilers)
Upvotes: 3
Reputation: 11
What fixed this problem for me was this missing package: avr-gcc-c++
. Running the command:
dnf install avr-gcc-c++
fixed it.
Upvotes: 1