Installer la SDL2 sur Qt Creator
Bonjour,
J'essaie depuis 2 heures de faire marcher la SDL2 avec qmake, mais ça ne veut pas :'(
Voici mon .pro :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13
| TEMPLATE = app
CONFIG += console c++11
CONFIG -= app_bundle
CONFIG -= qt
SOURCES += \
main.cpp
INCLUDEPATH += C:\SDL2-2.0.8\i686-w64-mingw32\include
LIBS += -LC:/SDL2-2.0.8/i686-w64-mingw32/lib -llibSDL2main -llibSDL2.dll |
Et voici l'erreur de compilation :
crt0_c.c:-1: error: undefined reference to `WinMain@16'
Voici mon code source, mais cela me m'étonnerait que cela soit la source du problème :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
| #include <SDL2/SDL.h>
int main(int argc, char *argv[])
{
/* Initialisation simple */
if (SDL_Init(SDL_INIT_VIDEO) != 0 )
{
return -1;
}
else
{
/* Création de la fenêtre */
SDL_Window* pWindow = NULL;
pWindow = SDL_CreateWindow("Ma première application SDL2",SDL_WINDOWPOS_UNDEFINED,
SDL_WINDOWPOS_UNDEFINED,
640,
480,
SDL_WINDOW_SHOWN);
if( pWindow )
{
SDL_Delay(3000); /* Attendre trois secondes, que l'utilisateur voie la fenêtre */
SDL_DestroyWindow(pWindow);
}
}
SDL_Quit();
return 0;
} |
Merci d'avance :)