title: Allegro 5 "Has stopped working" when loading a font
body: <p>Title says it all. I'm (trying to) load a font in Allegro 5. Running the code at the bottom of this post results in a blank white window opening (desired) but crashes with "TSAGAME.EXE has stopped working" (not desired). Command prompt returns with a random negative number</p>
  
  <p>The "problem details" dialogue is here: <a href="http://pastebin.com/Vc89wfwy" rel="nofollow">http://pastebin.com/Vc89wfwy</a></p>
  
  <p>I have tested the "font" variable (Between lines 24 and 25). It's not null.</p>
  
  <h1>Directory tree of my project folder:</h1>
  
  <pre><code>C:\Users\Andrew\Desktop\TSAGAME&gt;tree /F
  C:.
  │   allegro.log
  │   main.cpp
  │   Orbitron Black.ttf
  │   pirulen.ttf
  │   TSAGAME.cbp
  │   TSAGAME.depend
  │   TSAGAME.layout
  │
  ├───bin
  │   │   Orbitron Black.ttf
  │   │
  │   └───Debug
  │           allegro-5.0.10-monolith-mt-debug.dll
  │           Orbitron Black.ttf
  │           TSAGAME.exe
  │
  └───obj
      │   Orbitron Black.ttf
      │
      └───Debug
              main.o
              Orbitron Black.ttf
  </code></pre>
  
  <h1>Code::Blocks - Build Options - Linker Settings>Link Libraries:</h1>
  
  <p><code>C:\Users\Andrew\Documents\GitHub\Game4TSA\allegro\allegro-5.0.10-mingw-4.5.0\lib\liballegro-5.0.10-monolith-mt-debug.a</code></p>
  
  <h1>Code::Blocks - Build Options - Search Directories>Compiler:</h1>
  
  <p><code>C:\Users\Andrew\Documents\GitHub\Game4TSA\allegro\allegro-5.0.10-mingw-4.5.0\include</code></p>
  
  <h1>main.cpp:</h1>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;windows.h&gt;
  #include &lt;windowsx.h&gt;
  #include &lt;allegro5/allegro.h&gt;
  #include &lt;allegro5/allegro_native_dialog.h&gt;
  #include &lt;allegro5/allegro_ttf.h&gt;
  #include &lt;allegro5/allegro_font.h&gt;
  #include &lt;allegro5/allegro_primitives.h&gt;
  
  #define ScreenWidth 800
  #define ScreenHeight 600
  
  int main()
  {
  al_init();
  al_set_new_display_flags(ALLEGRO_WINDOWED);
  ALLEGRO_DISPLAY *display = al_create_display(ScreenWidth, ScreenHeight);
  al_set_window_position(display, 200, 100);
  al_set_window_title(display, "Neat a demo");
  al_init_font_addon();
  al_init_ttf_addon();
  
  ALLEGRO_FONT *font = al_load_font("C:/Users/Andrew/Desktop/TSAGAME/Orbitron Black.ttf", 10, 0);
  al_draw_text(font, al_map_rgb(44, 117, 255), 0, 0, NULL, "www");
  al_flip_display();
  al_rest(10.0);
  al_destroy_font(font);
  al_destroy_display(display);
  
  return 0;
  }
  </code></pre>
  
  <p>Ideas? I've been digging for a while. To put it simply:
  <a href="http://i.stack.imgur.com/VzNmw.png" rel="nofollow">xkcd, #979</a></p>