Vurdak829
July 23rd, 2005, 02:31 PM
Hi all! I'm a completely newbie with programming (schools teach only teory :( )but i've a problem with SDL and a very simple program.
#include "SDL/SDL.h"
#include <stdio.h>
int main() {
printf("Initializing SDL.\n");
if((SDL_Init(SDL_INIT_VIDEO|SDL_INIT_AUDIO)==-1)) {
printf("Could not initialize SDL: %s.\n", SDL_GetError());
exit(-1);
}
printf("SDL initialized.\n");
printf("Quiting SDL.\n");
SDL_Quit();
printf("Quiting....\n");
exit(0);
}
I get this errors:
example.c:24:2: warning: no newline at end of file
/tmp/ccUQ7KJs.o(.text+0x24): In function `main':
: undefined reference to `SDL_Init'
/tmp/ccUQ7KJs.o(.text+0x2e): In function `main':
: undefined reference to `SDL_GetError'
/tmp/ccUQ7KJs.o(.text+0x67): In function `main':
: undefined reference to `SDL_Quit'
collect2: ld returned 1 exit status
I have an ubuntu hoary 32bit, and i've installed libsdl1.2debian and libsdl1.2-dev. Thx to all :)
#include "SDL/SDL.h"
#include <stdio.h>
int main() {
printf("Initializing SDL.\n");
if((SDL_Init(SDL_INIT_VIDEO|SDL_INIT_AUDIO)==-1)) {
printf("Could not initialize SDL: %s.\n", SDL_GetError());
exit(-1);
}
printf("SDL initialized.\n");
printf("Quiting SDL.\n");
SDL_Quit();
printf("Quiting....\n");
exit(0);
}
I get this errors:
example.c:24:2: warning: no newline at end of file
/tmp/ccUQ7KJs.o(.text+0x24): In function `main':
: undefined reference to `SDL_Init'
/tmp/ccUQ7KJs.o(.text+0x2e): In function `main':
: undefined reference to `SDL_GetError'
/tmp/ccUQ7KJs.o(.text+0x67): In function `main':
: undefined reference to `SDL_Quit'
collect2: ld returned 1 exit status
I have an ubuntu hoary 32bit, and i've installed libsdl1.2debian and libsdl1.2-dev. Thx to all :)