title: 'Undefined reference to `WinMain' ' error on minimal script, Dev-C++
body: <p>I'm new to C and programming.
  I'm on Windows 10, I just installed Dev-C++ and I'm learning how to call functions from other files: i wrote this function to sum two numbers, and I call it from the main script.</p>
  <p>The problem is that when i compile the func.c file I get the error in title, so if I run the main file it doesn't recognize the &quot;sum&quot; function.
  This is the main.c file:</p>
  <pre><code>#include &lt;stdio.h&gt;
  #include &quot;func.h&quot; 
      main(){
        int x,y,s;
        scanf(&quot;%d %d&quot;,&amp;x,&amp;y);
        s = sum(x,y);
        printf(&quot;\n%d&quot;,s); 
        }
  </code></pre>
  <p>This is the header file:</p>
  <pre><code>#ifndef FUNC_H_INCLUDED
  #define FUNC_H_INCLUDED
  
  int func(int a, int b);
  
  #endif // FUNC_H_INCLUDED
  </code></pre>
  <p>And this is the code of the sum function in a func.c file:</p>
  <pre><code>#include &lt;stdio.h&gt;
  #include &quot;func.h&quot;
  int func(int a, int b){
      return(a+b);
  }
  </code></pre>
  <p>I did read lots of other questions, but they didnt help in my case, or I didnt get the tricky answer.
  Thank you.</p>