title: undefined reference to SDL_Init
body: <p>I started using SDL today and had some trouble before, now I got it running but it won't let me init it. </p>
  
  <p>This is my code:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include "SDL.h"
  #undef main
  
  using namespace std;
  
  int main(){
      if(SDL_Init(SDL_INIT_EVERYTHING)&lt;0){
          cout &lt;&lt; "error starting sdl" &lt;&lt; endl;
      }
      return 0;
  }
  </code></pre>
  
  <p>This the build log:</p>
  
  <pre><code>-------------- Build: Debug in Graphics (compiler: GNU GCC Compiler)---------------
  
  mingw32-g++.exe -Wall -g -std=c++11 -IC:\Users\73638G75MA\Documents\SDL2-2.0.3\x86_64-w64-mingw32\include\SDL2 -I"C:\Users\73638G75MA\Documents\C++ projects\Graphics" -c "C:\Users\73638G75MA\Documents\C++ projects\Graphics\main.cpp" -o obj\Debug\main.o
  mingw32-g++.exe -LC:\Users\73638G75MA\Documents\SDL2-2.0.3\x86_64-w64-mingw32\lib -o bin\Debug\Graphics.exe obj\Debug\main.o  -lmingw32 -lSDL2main -lSDL2  
  obj\Debug\main.o: In function `main':
  C:/Users/73638G75MA/Documents/C++ projects/Graphics/main.cpp:8: undefined reference to `SDL_Init'
  collect2.exe: error: ld returned 1 exit status
  Process terminated with status 1 (0 minute(s), 0 second(s))
  1 error(s), 0 warning(s) (0 minute(s), 0 second(s))
  </code></pre>
  
  <p>I would apreciate all possible help in this, the #undef main at the start is because it won't let me run it otherwise. If it isn't there it gives me a "undefined reference to winmain@16" While I am creating a console application.</p>