c++ - Using SDL2 with g++ / MinGW crashes on launch -


i working on game , made transition sdl 1.2 sdl2 (kinda late party heh). despite having no compilation or linking error whatsoever, program crashed on launch while stating (translated french) "the application failed start correctly". @ first thought own fault, got suspicious , put quick sdl2 test, indeed after flawless compilation crashed on launch.

here code i've been using example (you can't make more simple) :

#include <sdl.h>  int main(int argc, char *argv[]) {     return 0; } 

and compilation line g++ main.cpp -isdl2-2.0.4\x86_64-w64-mingw32\include\sdl2 -lsdl2-2.0.4\x86_64-w64-mingw32\lib -lmingw32 -lsdl2main -lsdl2 -otest.exe -fpermissive -std=c++11 -wno-write-strings -wno-overflow

for it's worth :

> g++ --version g++ (x86_64-win32-seh, built mingw-w64 project) 6.1.0 copyright (c) 2016 free software foundation, inc. free software; see source copying conditions.  there no warranty; not merchantability or fitness particular purpose. 

i'm running mingw-w64 on windows, can see. os windows 8.1.

welp. used wrong sdl2.dll. feel dumb now.


Comments