title: TTF_OpenFont returns "library not initialized" error
body: <p>I try to open a font via the <code>SDL_OpenFont()</code> function, but it returns <code>nullptr</code> and <code>TTF_GetError()</code> returns "Library not initialized".</p>
  
  <p><code>SDL_Init(SDL_INIT_EVERYTHING)</code> and <code>TTF_Init()</code> both return 0.</p>
  
  <pre><code>if(SDL_Init(SDL_INIT_EVERYTHING) &lt; 0) {
      std::cout &lt;&lt; "Couldn't initialize SDL: " &lt;&lt; SDL_GetError() &lt;&lt; std::endl;
      return 1;
  }
  
  if(TTF_Init() &lt; 0) {
      std::cout &lt;&lt; "Couldn't initialize TTF lib: " &lt;&lt; TTF_GetError() &lt;&lt; std::endl;
      return 1;
  }
  
  TTF_Font* font = TTF_OpenFont("DroidSans.ttf", 25);
  if(!font) {
      std::cout &lt;&lt; "Can't open font: " &lt;&lt; TTF_GetError() &lt;&lt; std::endl;
  }
  </code></pre>
  
  <p>This is the output:</p>
  
  <blockquote>
    <p>Can't open font: Library not initialized</p>
  </blockquote>
  
  <p>This is my <code>CMakeLists.txt</code>:</p>
  
  <pre><code>cmake_minimum_required(VERSION 3.9)
  project(proj)
  set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${proj_SOURCE_DIR}/bin)
  
  set(CMAKE_CXX_STANDARD 14)
  include_directories(${SDL2_INCLUDE_DIRS})
  
  INCLUDE(FindPkgConfig)
  PKG_SEARCH_MODULE(SDL2 REQUIRED sdl2)
  PKG_SEARCH_MODULE(SDL2TTF REQUIRED SDL_ttf &gt;= 2.0.0)
  
  set(SOURCES main.cpp)
  
  add_executable(proj ${SOURCES})
  target_link_libraries(proj ${SDL2_LIBRARIES} ${SDL2TTF_LIBRARIES})
  </code></pre>
  
  <p>What's wrong?</p>