[Linux] Probleme de compilation
Bonjour a tous,
Je debute sous Linux Fedora et j'aurai besoin d'aide pour compiler en c/c++
Apres avoir compiler le code suivant:
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 33 34 35
| #include "SDL/SDL.h"
#include <stdio.h>
#include <stdlib.h>
SDL_Surface* g_pMainSurface = NULL;
SDL_Event g_Event;
int main (int argc, char* argv[])
{if (SDL_Init(SDL_INIT_VIDEO)==-1)
{fprintf (stderr,"Could not initialize SDL!\n");
exit(1);
}
else
{fprintf(stdout,"SDL initialized properly!\n");
atexit(SDL_Quit);
}
g_pMainSurface = SDL_SetVideoMode(640,480,0,SDL_ANYFORMAT);
if (!g_pMainSurface)
{fprintf(stderr,"Could not create main surface!\n");
exit(1);
}
for (;;)
{if (SDL_WaitEvent(&g_Event)==0)
{fprintf(stderr,"Error while waiting for an event!\n");
exit(1);
}
// check the type of event
if (g_Event.type==SDL_QUIT)
{fprintf(stdout,"Quit event has occurred.\n");
break;
}
}
fprintf(stdout,"Terminating program normally.\n");
return(0);
} |
avec la ligne de commande suivante: gcc FocusOnSDL_1-2.c -lSDL
j'obtiens un fichier binaire a.out
Le fichier n'est pas executable sous le terminal
Code:
1 2 3
| [Roger@Amiga-Fun Games]$ /Roger/Programmation/Games/a.out
bash: /Roger/Programmation/Games/a.out: Aucun fichier ou dossier de ce type
[Roger@Amiga-Fun Games]$ |
Et quand je clique dessus dans un navigateur de fichier (Gnome) une fenetre s'ouvre avec juste un ecran noir
Quel est le probleme SVP ?
Merci d'avance pour votre aide