I’ve been unable to do anything with SDL. I’m trying to compile a very basic
programme, simply initialising things:
#include “include\SDL.h” /* All SDL App’s need this */
#include
#include <stdlib.h>
int main() {
printf("Initializing SDL.\n");
/* Initialize defaults, Video and Audio */
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");
/* Shutdown all subsystems */
SDL_Quit();
printf("Quiting....\n");
exit(0);
}
As you can see, it is one of the examples from the documentation (complete
with spelling errors). The problem is that it won’t compile. I get the
following error messages from both djgpp and Borland’s bcc32:
undefined reference to 'SDL_Init’
undefined reference to 'SDL_GetError’
undefined reference to ‘SDL_Quit’
They are found in files in the src directory - how can I get my compiler to
find them? I’ve tried playing with the system path to no avail. I’ve
specified sdl.c with an #include line, but it #includes sdl.h which it can’t
find. I’ve copied sdl.c to the \include directory, and found that there
are other source files linked that need to be moved, and so on…
What am I missing? Are all the source files supposed to be in the \include
directory? If so, why aren’t they there already? And why do the examples
#include sdl.h when it is sdl.c that needs linking?
Thanks.
squigger
My home page - http://www.hotkey.net.au/~jasonjob
Utter damnation upon, those who mangle and misuse comma’s and, apostrophes’