title: Setting up SDL2 with Eclipse and MinGW on Windows
body: <p>I'm trying to create a SDL2 project with Eclipse Kepler and MinGW on Windows.
  I already added SDL2 libs in MinGW (.a) in C:\MinGW\lib, SDL2 include in MinGW(C:\MinGW\include\SDL2) and I also added in projects properties -> C/C++ general -> paths and symbols -> librairies the following lines in that order :</p>
  
  <p>mingw32<br/>
   SDL2main<br/>
   SDL2</p>
  
  <p>Then I put '-mwindows' in MinGW C++ linker at the end of the line "Command line pattern"</p>
  
  <p>I also added -Dmain=SDL_main for the entry point...</p>
  
  <p>But the compiler gives me error :</p>
  
  <p>main.cpp:7: undefined reference to `SDL_CreateWindow'</p>
  
  <p>this is the code :</p>
  
  <pre><code>#include &lt;SDL2/SDL.h&gt;
  
  int main(int, char**)
  {
      SDL_Window *pWindow = nullptr;
  
      pFenetre = SDL_CreateWindow("Test SDL 2.0", 0, 0, 320, 240, SDL_WINDOW_SHOWN);
      if (!pWindow)
      {
          return -1;
      }
  
      SDL_DestroyWindow(pWindow);
  
      return 0;
  }
  </code></pre>
  
  <p>And this is the build console :</p>
  
  <pre>
  Info: Internal Builder is used for build
  g++ "-LC:\\MinGW\\lib" -o Test.exe main.o -lmingw32 -lSDL2main -lSDL2 -mwindows 
  main.o: In function `SDL_main':
  C:\Users\olivi_000\workspace\Test\Debug/../main.cpp:7: undefined reference to `SDL_CreateWindow'
  C:\Users\olivi_000\workspace\Test\Debug/../main.cpp:13: undefined reference to `SDL_DestroyWindow'
  C:\MinGW\lib/libmingw32.a(main.o):main.c:(.text.startup+0xa7): undefined reference to `WinMain@16'
  collect2.exe: erreur: ld a retourné 1 code d'état d'exécution
  </pre>
  
  <p>what's wrong ?</p>