title: C: Linking error for function of same signature
body: <p>I am getting a linking error when i run my program, even though the function signature is the same for both functions in test.h and test.c :</p>
  <p>test.h :</p>
  <pre><code>void function(int);
  </code></pre>
  <p>test.c :</p>
  <pre><code>#include &quot;test.h&quot;
  #include &quot;stdio.h&quot;
  
  static void function(int n) {
      printf(&quot;%d\n&quot;, n);
  }
  </code></pre>
  <p>main.c :</p>
  <pre><code>#include &quot;test.h&quot;
  
  int main() {
  
      function(5);
      return 0;
  }
  </code></pre>
  <p>this is the output:</p>
  <pre><code>Undefined symbols for architecture x86_64:
    &quot;_function&quot;, referenced from:
        _main in ccNaA2H2.o
  ld: symbol(s) not found for architecture x86_64
  collect2: error: ld returned 1 exit status
  </code></pre>
  <p>In class, I learned that the function signature is the function name and its parameters.
  So, why doesn't my program in main call function(5) in test.h which will call the function(5) in test.c ?</p>
  <p>Thank you</p>