title: FreeType library and "Undefined reference to FT_Init_FreeType"
body: <p>Coming from PHP, this is my first experience with C/C++ (so go easy on me). I'm following <a href="http://www.freetype.org/freetype2/docs/tutorial/step1.html" rel="noreferrer">this tutorial</a> to write a simple script using the FreeType library. The following compiles just fine:</p>
  
  <pre><code>#include &lt;ft2build.h&gt;
  #include FT_FREETYPE_H
  
  main() {
      FT_Library library;
      FT_Face face;
  }
  </code></pre>
  
  <p>This tells me that the FreeType library is readily available to the compiler. However, things break once I try to use any methods. For example, take the following script:</p>
  
  <pre><code>#include &lt;ft2build.h&gt;
  #include FT_FREETYPE_H
  
  main() {
  
      int error;
  
      FT_Library library;
      error = FT_Init_FreeType(&amp;library);
      if (error) {}
  
      FT_Face face;
      error = FT_New_Face(library, "/usr/share/fonts/truetype/arial.ttf", 0, &amp;face);
      if (error == FT_Err_Unknown_File_Format) {
          printf("Font format is unsupported");
      } else if (error) {
          prinft("Font file is missing or corrupted");
      }
  }
  </code></pre>
  
  <p>This script produces the following error upon compiling:</p>
  
  <pre><code>#gcc render.c -I/usr/include/freetype2
  /tmp/cc95255i.o: In function `main':
  render.c:(.text+0x10): undefined reference to `FT_Init_FreeType'
  render.c:(.text+0x30): undefined reference to `FT_New_Face'
  collect2: ld returned 1 exit status
  </code></pre>
  
  <p>Any ideas?</p>