title: Getting SDL2 to work on Clion, Windows 10 using MinGW
body: <p>I cannot for the life of me get SDL2 to work with my programming group's project.</p>
  
  <p>I'm using</p>
  
  <p>-Clion 1.2.1</p>
  
  <p>-SDL 2.0.3</p>
  
  <p>-MinGW 5.0</p>
  
  <p>The compiler starts yelling at me from within the Graphics.h file which includes SDL like so:</p>
  
  <pre><code>#include &lt;SDL.h&gt;
  #include &lt;SDL_image.h&gt;
  </code></pre>
  
  <p>with the error being:</p>
  
  <pre><code>fatal error: SDL.h: No such file or directory
  compilation terminated.
  </code></pre>
  
  <p>I tried including with</p>
  
  <pre><code>#include &lt;SDL2/SDL.h&gt;
  #include &lt;SDL2/SDL_image.h&gt;
  </code></pre>
  
  <p>which still yielded the same error. </p>
  
  <p>I downloaded SDL from the MinGW 32/64-bit download of development libraries from: <a href="https://www.libsdl.org/download-2.0.php" rel="nofollow">https://www.libsdl.org/download-2.0.php</a>. I also linked the respective ..\SDL2\x86_64-w64-mingw32\include and lib to path in system->advanced system settings->...</p>
  
  <p>Still nothing.</p>
  
  <pre><code>cmake_minimum_required(VERSION 3.3)
  project(ClionProjects)
  
  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -lsdl2")
  
  set(SOURCE_FILES
          Kod/Graphics/Graphics.cc
          Kod/Graphics/Graphics.h
          Kod/Game/Game.cc
          Kod/Game/Game.h
          Kod/Gameboard/Gameboard.cc
          Kod/Gameboard/Gameboard.h
          Kod/Meeple/Meeple.cc
          Kod/Meeple/Meeple.h
          Kod/Player/Player.cc
          Kod/Player/Player.h
          Kod/Resource/Resource.cc
          Kod/Resource/Resource.h
          Kod/Tile/Tile.cc
          Kod/Tile/Tile.h
          Kod/Carcassonne.cc)
  
  
  add_executable(ClionProjects ${SOURCE_FILES} Kod/Carcassonne.cc)
  target_link_libraries(ClionProjects SDL2main SDL2 SDL2_image)
  </code></pre>
  
  <p>is the cmakefile I have in Clion. I've been bashing my head bloody trying to get this to work and none of the previous Stackoverflow questions managed to solve my issue. </p>