Bug de SDL2

J'essaye de faire fonctionner une base de code de SDL2, mais le compilateur me dit que les fonctions n'existe pas alors que l'IDE me les propose et qu'elle sont dans SDL (j'ai pu remonter jusqu'à leur déclaration).
Pour info je suis sous Code::Blocks.
Mon code :
#include <stdlib.h>

#include <stdio.h>

#include <SDL2/SDL.h>

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

{

    SDL_Surface *ecran = NULL;
    SDL_Init(SDL_INIT_VIDEO);


    ecran = SDL_SetVideoMode(640, 256, 32, SDL_HWSURFACE);


    SDL_Quit();


    return EXIT_SUCCESS;

}


Compilateur :
g++ -Wall -g  -c /home/fabio/Documents/C/Boxing/main.cpp -o obj/Debug/main.o
/home/fabio/Documents/C/Boxing/main.cpp: In function ‘int main(int, char**)’:
/home/fabio/Documents/C/Boxing/main.cpp:15:44: error: ‘SDL_HWSURFACE’ was not declared in this scope
     ecran = SDL_SetVideoMode(640, 256, 32, SDL_HWSURFACE);
                                            ^
/home/fabio/Documents/C/Boxing/main.cpp:15:57: error: ‘SDL_SetVideoMode’ was not declared in this scope
     ecran = SDL_SetVideoMode(640, 256, 32, SDL_HWSURFACE);
                                                         ^
Process terminated with status 1 (0 minute(s), 0 second(s))
2 error(s), 0 warning(s) (0 minute(s), 0 second(s))
 

2 réponses

  1. Justement, mon IDE me propose cette fonction, c'est ça qui m'intrigue, mais je vais regarder ton lien, merci
    0