title: Conflicting types compilation error when my function has the same profile both in .h and .c files
body: <p>I have the following compilation error:</p>
  
  <pre><code>gcc -Wall -ggdb -c code_generation.c
  code_generation.c:3:6: error: conflicting types for ‘generateFile’
  void generateFile(FILE *fp, char *filename, char *result){
       ^
  code_generation.h:4:6: note: previous declaration of ‘generateFile’ was here
  </code></pre>
  
  <p>And I don't understand where it's coming from. Here is my function declaration in the code_generation.h file:</p>
  
  <pre><code>#pragma once
  #include &lt;stdio.h&gt;
  #include &lt;string.h&gt;
  
  void generateFile(FILE *fp, char *filename, char *result);
  void generateInitDec(FILE *fp, char *filename);
  </code></pre>
  
  <p>And here is my definition in the code_generation.c file:</p>
  
  <pre><code>#include "code_generation.h"
  
  void generateFile(FILE *fp, char *filename, char *result){
      char *res = NULL;
  
      memset(result, 0, sizeof(result));
      res = strrchr(filename, '.');
      if(res != NULL)
      *res = '\0';
  
      sprintf(result, "%s.nasm", filename);
      fp = fopen(result, "w");
      fprintf(fp, "%s 'io.asm'\n", "%include");
  }
  </code></pre>
  
  <p>As you can see, both profiles are strictly the same, so I'm having a hard time understanding the error, and I don't understand how to correct it.</p>
  
  <p>Could you fill me in on what is the meaning of this error, and how to fix it?</p>
  
  <p>Thanks in advance.</p>
  
  <p>Edit: As suggested, I addded -H to my compiler command line. I have the following lines when the compiler comes around code_generations.c/h:</p>
  
  <pre><code>gcc -Wall -ggdb -H -c code_generation.c
  ! code_generation.h.gch
   code_generation.c
  </code></pre>
  
  <p>When on other files, it looks like that:
      gcc -Wall -ggdb -H -c affiche_arbre_abstrait.c</p>
  
  <p>With no further warning concerning the .h file.
  My code_generation.h file isn't different than any other though, so where can it be coming from?</p>