- - - - - #ifdef HAVE_CONFIG_H #include <config.h> #endif
#include <iostream.h> #include <stdlib.h>
#include <SDL/SDL.h>
int main(int argc, char *argv[]) { SDL_Surface* screen;
// cout << "Hello, World!" << endl; if(!SDL_Init(SDL_INIT_EVERYTHING)) { cout << "SDL error: " << SDL_GetError() << "\n" << endl; }
screen = SDL_SetVideoMode(240, 320, 16, SDL_SWSURFACE | SDL_DOUBLEBUF); if(NULL == screen) { cout << "Video error: " << SDL_GetError() << "\n" << endl; exit(1); }
SDL_WM_SetCaption("fighter", NULL);
SDL_Quit(); return EXIT_SUCCESS; } - - - - -
- Theo
Kwan Lowe wrote:
Not trying to complie KDevelop, no. I'm trying my hand at writing a couple small games (hopefully, with experience I'll try my hand at some larger games as well), but I can't even get the SDL equivalent of 'Hello World' to compile. I get an 'undefined reference to 'SDL_*' error for each SDL_* function call I make. I've got #include <SDL/SDL.h> up with the rest of the includes, and it isn't complaining about being able to find SDL.h any more, but it won't compile because of the undefined reference errors.
Shoot me some example code if you'd like. I just compiled a couple of the example applications from the SDL library and they worked fine under Kdevelop.
------------------------------------------------------------------------
Want to buy your Pack or Services from MandrakeSoft? Go to http://www.mandrakestore.com
Want to buy your Pack or Services from MandrakeSoft? Go to http://www.mandrakestore.com