title: How do I link to FreeImage?
body: <p>I am using Kubuntu 14.04, and installed the FreeImage library with</p>
  
  <pre><code>sudo apt-get install libfreeimage-dev
  </code></pre>
  
  <p>As far as I can tell, it is correctly installed, with <code>FreeImage.h</code> in <code>/usr/include</code> and <code>libfreeimage.a</code> in <code>/usr/lib</code>. However, this trivial C program</p>
  
  <pre><code>#include &lt;FreeImage.h&gt;
  
  int main(int argc, char **argv) {
  
    FreeImage_Initialise(FALSE);
    FreeImage_DeInitialise();
    return 0;
  
  }
  </code></pre>
  
  <p>fails to compile. Running</p>
  
  <pre><code>gcc -lfreeimage fitest.c -o fitest
  </code></pre>
  
  <p>outputs</p>
  
  <pre><code>/tmp/ccFbb0HQ.o: In function `main':
  fitest.c:(.text+0x15): undefined reference to `FreeImage_Initialise'
  fitest.c:(.text+0x1a): undefined reference to `FreeImage_DeInitialise'
  collect2: error: ld returned 1 exit status
  </code></pre>
  
  <p>What am I doing wrong?</p>