title: Undefined reference with FreeType 2
body: <p>I am getting undefined reference error while building a simple example with <a href="https://en.wikipedia.org/wiki/FreeType" rel="nofollow">FreeType</a> 2.</p>
  
  <pre><code>gcc `/usr/bin/freetype-config --cflags`  `/usr/bin/freetype-config --libs` a.c 
  /tmp/ccuSpdkr.o: In function `main':
  a.c:(.text+0x10): undefined reference to `FT_Init_FreeType'
  collect2: error: ld returned 1 exit status
  </code></pre>
  
  <p>I am on Ubuntu 12.10 x64. Package libfreetype6 &amp; libfreetype6-dev are installed.</p>
  
  <p>File <code>a.c</code> is:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;ft2build.h&gt; 
  #include FT_FREETYPE_H
  
  int main() {
    FT_Library library;
    FT_Init_FreeType( &amp;library );
    return 0;
  }
  </code></pre>
  
  <p>I tried 2 step compilation, to make sure everything is on 64 bit:</p>
  
  <pre><code>&gt; gcc -c `/usr/bin/freetype-config --cflags` a.c
  &gt; file a.o
  a.o: ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), not stripped
  &gt; /usr/bin/freetype-config --cflags
  -I/usr/include/freetype2
  &gt; /usr/bin/freetype-config --libs
  -L/usr/lib/x86_64-linux-gnu -lfreetype -lz
  &gt; file /usr/lib/x86_64-linux-gnu/libfreetype.so.6.9.0
  /usr/lib/x86_64-linux-gnu/libfreetype.so.6.9.0: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, BuildID[sha1]=0x8ed223c2650372fc88b41fd348a72f03329adefa, stripped
  </code></pre>
  
  <p>What am I missing?</p>