title: using header in netbeans C
body: <p>I tried to compile a simple C program with a header, a main, and another source file in <code>Netbeans</code> but it didn't work. I always get a huge error message.</p>
  
  <p>I have absolutely no idea what I can do to make it work. Hope you guy can help me.</p>
  
  <p>console:</p>
  
  <pre><code>"/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
  make[1]: Entering directory `/home/***/***/***/***/***/headertest'
  nbproject/Makefile-Debug.mk:73: warning: overriding commands for target `build/Debug/GNU-Linux-x86/header.o'
  nbproject/Makefile-Debug.mk:68: warning: ignoring old commands for target `build/Debug/GNU-Linux-x86/header.o'
  "/usr/bin/make"  -f nbproject/Makefile-Debug.mk dist/Debug/GNU-Linux-x86/headertest
  make[2]: Entering directory `//home/***/***/***/***/***/headertest'
  nbproject/Makefile-Debug.mk:73: warning: overriding commands for target `build/Debug/GNU-Linux-x86/header.o'
  nbproject/Makefile-Debug.mk:68: warning: ignoring old commands for target `build/Debug/GNU-Linux-x86/header.o'
  mkdir -p build/Debug/GNU-Linux-x86
  rm -f "build/Debug/GNU-Linux-x86/header.o.d"
  gcc    -c -g -MMD -MP -MF "build/Debug/GNU-Linux-x86/header.o.d" -o build/Debug/GNU-Linux-x86/header.o header.h
  mkdir -p build/Debug/GNU-Linux-x86
  rm -f "build/Debug/GNU-Linux-x86/main.o.d"
  gcc    -c -g -MMD -MP -MF "build/Debug/GNU-Linux-x86/main.o.d" -o build/Debug/GNU-Linux-x86/main.o main.c
  mkdir -p dist/Debug/GNU-Linux-x86
  gcc     -o dist/Debug/GNU-Linux-x86/headertest build/Debug/GNU-Linux-x86/header.o build/Debug/GNU-Linux-x86/header.o build/Debug/GNU-Linux-x86/main.o
  /usr/bin/ld:build/Debug/GNU-Linux-x86/header.o: file format not recognized; treating as linker script
  /usr/bin/ld:build/Debug/GNU-Linux-x86/header.o:1: syntax error
  collect2: error: ld returned 1 exit status
  make[2]: *** [dist/Debug/GNU-Linux-x86/headertest] Error 1
  make[2]: Leaving directory `/home/***/***/***/***/***/headertest'
  make[1]: *** [.build-conf] Error 2
  make[1]: Leaving directory `/home/***/***/***/***/***/headertest'
  make: *** [.build-impl] Error 2
  
  BUILD FAILED (exit value 2, total time: 283ms)
  </code></pre>
  
  <p>Here is the rest of my code:
  main.c</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include "header.h"
  
  int main(int argc, char** argv) {
  
      lol();
  
      return (EXIT_SUCCESS);
  }
  </code></pre>
  
  <p>header.c</p>
  
  <pre><code>#include "header.h"
  
  void lol(){
      printf("lol");
  }
  </code></pre>
  
  <p>header.h</p>
  
  <pre><code>#ifndef HEADER_H
  #define   HEADER_H
  #ifdef   __cplusplus
  extern "C" {
  #endif
  
  void lol();
  
  #ifdef   __cplusplus
  }
  #endif
  #endif   /* HEADER_H */
  </code></pre>