user42900: 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 <avr/io.h>                                                                                                                                                                    

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

Thank you in advance!

user25690: 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.

42900: <p>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 </p>

<pre><code>avr-gcc -mmcu=atmega328p -o main.out main.c
</code></pre>

<p>I get the error:</p>

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

<p>I am running OpenSUSE Leap 42.3 and i have installed <strong>avr-gcc</strong>, <strong>avr-libc</strong>.</p>

<p>My code:</p>

<pre><code>#include &lt;avr/io.h&gt;                                                                                                                                                                    

int main() {
    DDRB = 1;
    PORTB = 1;
}
</code></pre>

<p>Thank you in advance!</p>
 25690: <p>I’m guessing you started with the toolchain Arduino put on your machine. </p>

<p>Try explicitly including the header files on the include path with the <code>-I</code> switch. </p>

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

<p>Just search for the <code>io.h</code> file. It should be somewhere close by to where you found the compiler.</p>
