On Eclipse CDT Helios + Mingw64 + SDL2 + SDL_Image:
IMG_Init
make the window not showing anymore.
This problem occurs only on Eclipse. Hand compile(using same configurations) on console and running it works fine.
This is my code:
#include <SDL2/SDL.h>
#include <SDL_image.h>
int main(int argc, char* argv[]) {
SDL_Init(SDL_INIT_EVERYTHING);
IMG_Init(IMG_INIT_PNG);//this line is the issue
SDL_Window *window = 0;
window = SDL_CreateWindow("Hello World!",
SDL_WINDOWPOS_CENTERED,
SDL_WINDOWPOS_CENTERED,
640, 480,
SDL_WINDOW_SHOWN);
SDL_Delay(2000);
SDL_DestroyWindow(window);
SDL_Quit();
return 0;
}