title: Compiling multiple C files in a program
body: <p>I have the following two files:</p>
  
  <p><strong>file1.c</strong></p>
  
  <pre><code>int main(){
    foo();
    return 0;
  }
  </code></pre>
  
  <p><strong>file2.c</strong></p>
  
  <pre><code>void foo(){
  
   }
  </code></pre>
  
  <p>Can I compile and link the two files together so the <code>file1.c</code> will recognize the <code>foo</code> function without adding <code>extern</code>?</p>
  
  <p>Updated the prototype.</p>
  
  <blockquote>
    <p>gcc file1.c file2.c throws: warning: implicit declaration of function foo.</p>
  </blockquote>