title: SDL_ttf doesn't run correctly
body: <p>I am using SDL_ttf but in mingw32, I download everything and try the following program</p>
  
  <pre><code>#include &lt;SDL.h&gt;
  #include "SDL_ttf.h"
  #include &lt;iostream&gt;
  
  using namespace std;
  
  const int window_width = 600;
  const int window_height = 600;
  
  TTF_Font *font;
  SDL_Surface *screen;
  
  void init(void)
  {
    SDL_putenv("SDL_VIDEO_CENTERED=center");
    if (TTF_Init() == -1)
    {
      cerr &lt;&lt; "Unable to initialize SDL_tff: " &lt;&lt; TTF_GetError() &lt;&lt; endl;
      exit(1);
    }
    font = TTF_OpenFont("arial.ttf", 12);
  
    if (SDL_Init(SDL_INIT_EVERYTHING) &lt; 0)   exit(2);
    if ( (screen = SDL_SetVideoMode(window_width, window_height, 8, SDL_HWSURFACE |     SDL_DOUBLEBUF)) == NULL)   exit(3);
   }
  
  void drawText(SDL_Surface *screen, int x, int y, string text)
  {
    SDL_Color foregroundColor = { 255, 255, 255 };
    SDL_Color backgroundColor = { 0, 0, 255 };
    SDL_Surface *resulting_text;
    SDL_Rect rect = { x, y, 0, 0 };
    resulting_text = TTF_RenderText_Solid(font, text.c_str(), foregroundColor);
    cout &lt;&lt; SDL_GetError();
    SDL_BlitSurface(resulting_text, NULL, screen, &amp;rect);
    SDL_FreeSurface(resulting_text); 
  }
  
  void run()
  {
    SDL_Event event;
    bool running = true;
    while (running) 
    {
      SDL_LockSurface(screen);
      char s[256];
      drawText(screen, 20, 20, "text ................");
      SDL_UpdateRect(screen, 0, 0, window_width, window_height);
      SDL_UnlockSurface(screen);
      while (SDL_PollEvent(&amp;event)) 
      {
        if (event.type == SDL_KEYDOWN)
        {
      SDLKey _key = event.key.keysym.sym;
          if ((_key == 27) || (_key == 'q') || (_key == 'Q')) 
      {
        running = false;
      }
        }
      }
    }
  }
  </code></pre>
  
  <p>int main(int argc, char* argv[])
     {
       init();
       run();
     }</p>
  
  <p>Ok, so here I post all code. I also copy the font file to the current folder but it is not effective nor showing any error or warning. I compile this in mingw32 with the following command</p>
  
  <pre><code>g++ SDLTestFont.cpp -o TF.exe -I"d:\SDL\include" -lmingw32 -lSDLmain
  </code></pre>
  
  <p>lSDL SDL_ttf.lib -mwindows -O3 -w -static</p>