title: Linker warnings when using extern reference to a pointer-to-function
body: <p><strong>Api.cpp:</strong></p>
  <pre><code>int (*theFunc) (int);
  theFunc = (int (*) (int)) DlSym(hSo, &quot;theFunc&quot;);
  </code></pre>
  <p>So far so good.</p>
  <p>Now, I want to make a header so that other cpp files can also call theFunc.</p>
  <hr />
  <p><strong>Api.h:</strong> per <a href="https://stackoverflow.com/questions/8562694/how-to-declare-function-pointer-in-header-and-c-file">How to declare function pointer in header and c-file?</a></p>
  <pre><code>extern int (*theFunc)(int);
  </code></pre>
  <blockquote>
  <p>/usr/bin/ld: Warning: type of symbol `theFunc' changed from 2 to 1 in Api.o</p>
  </blockquote>
  <p>OK, so this is a warning that theFunc is seen as a function from one compilation element and as a variable in another.  <a href="http://sourceware.org/ml/binutils/2008-03/msg00269.html" rel="nofollow noreferrer">(Reference)</a> This seems like bad things will happen at runtime.</p>
  <p>This seems to be a proper declaration, what am I doing wrong?</p>
  <p><em>Edit:  Actually running in linux, so use DlSym not Microsoft GetProcAddress() call</em></p>