Q:

Duplicate error: C file include

One of my questions, as I'm pretty new to C is about ways to avoid getting the duplication error. Basically, when I build the project in Netbeans if I have the file in the project and also include it, I get that error.  
Defining the functions static, is a correct way to avoid it? What other solutions are there? Thanks

A:

As K. Horvath says, you shouldn't be including one c file in another.  This means you have to provide an .h for each .c, compile the .c files into object files, then include the .h files as necessary and compile all the objects together with the .c containing main().  You can still end up with duplication in the .h declarations, however, which is where include guards come in.
#ifndef MY_HEADER
#define MY_HEADER

// all your type definitions, function prototypes, etc

#endif

WRT compiling each .c first, here's an example for gcc: you have a util.c file with various functions you want to use in main.c; util.c should then have a corresponding util.h you #include in main.c.  Then:
gcc -Wall -g -c util.c

"-Wall" enable compiler warnings
"-g" include debugger symbols
"-c" will produce a .o (unlinked intermediate object) file instead of a normal executable.
Now:
gcc -Wall -g util.o main.c

This compiles main.c and includes the stuff from util.c which was compiled into util.o.
Since you're using netbeans, this may be theoretical -- generally IDE's do all that for you.  However, understanding the fundamental process may make it easier to understand your IDE ;)

