SDL Trouble? Look Here.

Started by
14 comments, last by Drew_Benton 18 years, 11 months ago
Quote:Original post by Drew_Benton
I say we all band together to promote and contribute to that Wiki [smile]

That would be excellent! Any and all contributions are certainly welcomed :)

The wiki craves information!
--Visit the Game Programming Wiki!
Advertisement
From past experience I've found that the error caused by forgetting to set the code generation options to multi-threaded dll is multiple defined symbols in the standard libs which will cause the build the fail - not a standard lib conflict which isn't fatal in itself.

Apart from that great job, I'm surprised no-one (including myself) hasn't thought of making such a thread before. Having a Wiki for this sort of information would be an invaluable source of information for new SDL users.
Quote:
This could happen for a couple of reasons. Most of the time it's because of the way the libraries need to be linked in the code. To resolve this, add these lines to your main source file, or to a header file linked into your main source file:

#pragma comment(lib, "SDL.lib")
#pragma comment(lib, "SDLmain.lib")

If this doesn't work, then you might have a very subtle and sneaky problem. This one hasn't bitten me, but I've seen it get others. When using SDL, you cannot have a void parameter list for your main function. You must use the command line variables.

int main(void) // Bad
int main() // Bad
int main(int argc char **argv) // Good


Oh yeah, this one is very familiar.
-----------------------------Play Stompy's Revenge! Now!
Getting console output with dev-cpp is worth a mention.
Quote:Original post by Rhaal
Everything compiles but the screen and/or a surface is blank
    This one can be tricky once your program starts gaining size and you Separate your code. Make sure you initialize SDL's video system and set the video mode BEFORE attempting to render anything.


I dunno if anyone else ever does this, but usually when I get a blank screen, its because I forgot to call SDL_Flip() (or SDL_GL_SwapBuffers()) after rendering everything. That'd maybe be an interesting little tidbit to add to your excellent little mini-faq.
------------------------------BASIC programmers don't die, they just GOSUB and don't return.
I have one more week of long hard Uni. finals then I'm on summer vacation. During that time, I will start to add to the Wiki, I haven't forgotten about it!

This topic is closed to new replies.

Advertisement