title: undefined reference to 'WinMain' with SDL compiling in a native enviroment
body: <p>I'm struggeling with my first steps in SDL.
  I wanted to compile a simple test class, just including the SDL2 header, nothing special for startup:</p>
  
  <p>main.cpp:</p>
  
  <pre><code>#include &lt;SDL.h&gt;
  
  int main() {
      return 0;
  }
  </code></pre>
  
  <p>main.cpp itself compiles fine:
  <code>g++ -c main.cpp -ISDL/include</code></p>
  
  <p>but as soon as i want to link it with the SDL2.dll either with the machinecode main.o or directly, i'm getting this error:
  <code>g++ main.cpp -o sdl_test -I SDL/include -L SDL/lib/x64 -l SDL2 -mwindows</code>
  <code>g++ -o test main.o -L SDL/lib/x64 -l SDL2 -mwindows</code></p>
  
  <pre><code>/usr/lib/gcc/x86_64-pc-cygwin/4.8.3/../../../../lib/libcygwin.a(libcmain.o): In function `main':
  /usr/src/debug/cygwin-1.7.30-1/winsup/cygwin/lib/libcmain.c:39: undefined reference to `WinMain'
  /usr/src/debug/cygwin-1.7.30-1/winsup/cygwin/lib/libcmain.c:39:(.text.startup+0x7e): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `WinMain'
  collect2: Fehler: ld gab 1 als Ende-Status zurück
  </code></pre>
  
  <p>Additional Information:
  I use Cygwin and obviously g++ to compile my C++ code. My OS is Windows 7 Professional 64Bit SP 1.</p>
  
  <p>I googled for several hours but all the results I came across said use <code>-mwindows</code> to compile a non console application or other things which didn't worked out.</p>