compiled error
error occured while compiling, i got the wrong messages like below:
/tmp/cc4/HK9Z5.o (text+0x16): in function 'main' :undefined reference to 'SDL_Init' the command for compilation is : gcc -o sdl sdl.c -W -I /usr/include/SDL the score code is: #include <stdlib.h> #include "SDL.h" main(int argc, char *argv[]) { if ( SDL_Init(SDL_INIT_AUDIO|SDL_INIT_VIDEO) < 0 ) { fprintf(stderr, "can't initilize SDL: %s\n", SDL_GetError()); exit(1); } atexit(SDL_Quit); } thanks in advance. |
I haven't used SDL before, but I think using this might make it work:
Code:
$ gcc -o sdl sdl.c -W -I /usr/include/SDL -lSDL Code:
$ sdl-config --libs ~sind |
You need to link to the SDL library, check the docs for SDL, they should have sample make files.
|
All times are GMT -5. The time now is 12:24 PM. |