avr/io.h No such file or directory error when compiling using avr-gcc I am trying to use the atmega328p as standalone microchip and program it. I ama using an Arduino Uno as ISP. I have written a simple program to test it however when I try to compile it using 

avr-gcc -mmcu=atmega328p -o main.out main.c


I get the error:

main.c:1:20: fatal error: avr/io.h: No such file or directory
compilation terminated.


I am running OpenSUSE Leap 42.3 and i have installed avr-gcc, avr-libc.

My code:

#include &lt;avr/io.h&gt;                                                                                                                                                                    

int main() {
    DDRB = 1;
    PORTB = 1;
}


Thank you in advance!
I’m guessing you started with the toolchain Arduino put on your machine. 

Try explicitly including the header files on the include path with the -I switch. 

avr-gcc -mmcu=atmega328p -I /path/to/avr/include -o main.out main.c


Just search for the io.h file. It should be somewhere close by to where you found the compiler.