Codeblocks / SDL - undefined reference to `WinMain@16'

Ive searched all over and this fourm and im still not able to figure out what i need to do to get rid of this error.

I followed this tutorial and did everything it said but im still getting this error.

I have in Build Options > Linker Settings > Other Linker Options: ( -lmingw32 -lSDL2main -lSDL2 ) without parenthesis.

Search Directorys have Include and Lib added in…

Heres my code in main. When i comment out sdl.h the error goes away.

#include <stdio.h>
#include <cstdlib> // For some useful functions such as atexit :)

#include "SDL2/SDL.h" // main SDL header

using namespace std;

int END_GAME=0;

//undefined reference to `WinMain@16'

int main(int argc, char* argv[])

    return 0;

Does anyone have any idea what i may be doing wrong?

i think you use x86_64-w64-mingw32 instead i686-w64-mingw32 :slight_smile: