Can't Get SDL Started!

Started by
22 comments, last by ozzoright 18 years ago
Still won't work... heres the code:

#include "SDL/SDL.h" //EDIT: This is the line with the error message.

int main()
{
//Start SDL
SDL_Init( SDL_INIT_EVERYTHING );

//Quit SDL
SDL_Quit();

return 0;
}

Anything wrong? I'm getting "Build Error".

Thanks.
Advertisement
You have to add these parameters in the main function. int argc, char* args[]
like this:
int main(int argc, char* args[]) {

Quote:Original post by password
You have to add these parameters in the main function. int argc, char* args[]
like this:
int main(int argc, char* args[]) {


And to elaborate, this is because SDL does some funky #defining and renaming to get itself to work. What happens is that your function "main" is actually renambed to SDL_Main(...).

So, when you don't specify the correct params, SDL won't know what to replace.

The only exclusion is when you compile under linux... IIRC, compiling under linux accepts just "main()".
WOW! Works fine, no errors. Thanks guys, I really appreciate it, I had alot of trouble trying to get this thing to work. Thank you all so much! :) :) :)

This topic is closed to new replies.

Advertisement