PLEASE READ YOUR OTHER THREAD or I will ask for you to be banned!!
Follow this link if you are NOT a troll; if you are a troll get lost!
Edit: Sorry, at first reading it looked like you were a newbie, who failed to read the replies to your first post.
But, you are just a newbie who starts new threads for no reason, instead.
I suggest you fix the main function to match what is on the link below look up one FAQ.
http://wiki.libsdl.org/FAQWindows#I_get_.22Undefined_reference_to_.27WinMain.4016.27.22
What you should have
int main(int argc, char *argv[])
Tim S.
Example of posting code in code tags.
NOTICE: The main function is "int main(int, char**)" instead of "int main()" this makes a difference; but, my prior note of this was NOT understood by you. Edti2: If you do NOT fix that you will in time get. "undefined reference to `SDL_main'"
Edit: This is the simplest SDL2 code I know about it does nothing besides inits and quits SDL2.
Tim S.
#include <iostream>
#include <SDL2/SDL.h>
int main(int, char**){
if (SDL_Init(SDL_INIT_VIDEO) != 0){
std::cout << "SDL_Init Error: " << SDL_GetError() << std::endl;
return 1;
}
SDL_Quit();
return 0;
}
Edit3: Added build and run logs.
-------------- Build: Release in SDL2_Test (compiler: GNU GCC Compiler)---------------
mingw32-g++.exe -Wall -O2 -IC:\SDL2-2.0.5\i686-w64-mingw32\include -c C:\Devel\open_source_code\no_version_control\Test\SDL2_Test\main.cpp -o obj\Release\main.o
mingw32-g++.exe -LC:\SDL2-2.0.5\i686-w64-mingw32\lib -LC:\SDL2-2.0.5\i686-w64-mingw32\bin -o bin\Release\SDL2_Test.exe obj\Release\main.o -lmingw32 -lSDL2main -lSDL2 -s
Output file is bin\Release\SDL2_Test.exe with size 544.50 KB
Process terminated with status 0 (0 minute(s), 2 second(s))
0 error(s), 0 warning(s) (0 minute(s), 2 second(s))
-------------- Run: Release in SDL2_Test (compiler: GNU GCC Compiler)---------------
Checking for existence: C:\Devel\open_source_code\no_version_control\Test\SDL2_Test\bin\Release\SDL2_Test.exe
Executing: "C:\Program Files\CodeBlocks/cb_console_runner.exe" "C:\Devel\open_source_code\no_version_control\Test\SDL2_Test\bin\Release\SDL2_Test.exe" (in C:\Devel\open_source_code\no_version_control\Test\SDL2_Test\.)
Process terminated with status 0 (0 minute(s), 2 second(s))