with this code
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <SDL2/SDL.h>
int main(int argc, char *argv[])
{
SDL_Init(SDL_INIT_VIDEO); // Démarrage de la SDL (ici : chargement du système vidéo)
/*
La SDL are loaded.
program loaded, write your code here !!!
*/
SDL_Quit(); // Arrêt de la SDL (libération de la mémoire).
return 0;
}
this is my output of built log !
-------------- Build: Debug in test_sdl2_101 (compile: GNU GCC Compiler) ---------------
gcc -Wall -g -I ../../../../../ usr / include / SDL -c /home/phipo/c/perso/essai_sdl2_101/main.c -o obj / Debug / main .o
g ++ -L / usr / include / SDL -L / usr / include / SDL2 -o bin / Debug / test_sdl2_101 obj / Debug / main.o
obj / Debug / main.o: In the "main" function:
/home/phipo/c/perso/essai_sdl2_101/main.c:11: Indefinite reference to "SDL_Init"
/home/phipo/c/perso/essai_sdl2_101/main.c:25: Indefinite reference to "SDL_Quit"
collect2: error: ld returned output status 1
Process terminated with status 1 (0 minute (s), 0 second (s))
1 error (s), 0 warning (s) (0 minute (s), 0 second (s))
Should you make a program with an initialization of the SDL?
with this program I should get the window as an attachment
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <SDL2/SDL.h>
void pause();
int main(int argc, char *argv[])
{
SDL_Init(SDL_INIT_VIDEO); // Initialisation de la SDL
SDL_SetVideoMode(640, 480, 32, SDL_HWSURFACE); // Ouverture de la fenêtre
pause(); // Mise en pause du programme
SDL_Quit(); // Arrêt de la SDL
return EXIT_SUCCESS; // Fermeture du programme
}
void pause()
{
int continuer = 1;
SDL_Event event;
while (continuer)
{
SDL_WaitEvent(&event);
switch(event.type)
{
case SDL_QUIT:
continuer = 0;
}
}
}
rhe swall image !!
(https://image.noelshack.com/minis/2018/21/4/1527132135-9505.png) (https://www.noelshack.com/2018-21-4-1527132135-9505.png)