Pelles C forum

C language => Graphics programming => Topic started by: PaulR on August 15, 2012, 12:17:30 PM

Title: Setting Up SDL
Post by: PaulR on August 15, 2012, 12:17:30 PM
I've been trying to set up SDL in a 'clean' way such that header files and libraries are kept separate from Pelles C files. This will enable both to be upgraded easily without causing problems.

This applies to version 7.0 of Pelles C and SDL 1.2.15.

Here's what I did:


Code: [Select]
#include <SDL.h>
int main( int argc, char* args[] ) {
//Start SDL
SDL_Init( SDL_INIT_EVERYTHING );
//Quit SDL
        SDL_Quit();
return 0;
}

Results of building:

Building main.obj.
Use <stdlib.h> instead of non-standard <malloc.h>
Building main.exe.
Done.

Just one warning which can be cured by a couple of simple edits if required (replacing malloc.h with stdlib.h), see  http://forum.pellesc.de/index.php?topic=2858.0

Paul

Title: Re: Setting Up SDL
Post by: TimoVJL on August 15, 2012, 03:30:59 PM
Remember to compile SDL_win32_main.c with PellesC to library SDLmain.lib .
Or use this one as attached.

Here is modified source for that: http://forum.pellesc.de/index.php?topic=3194.msg14341#msg14341
Title: Re: Setting Up SDL
Post by: PaulR on August 15, 2012, 03:47:27 PM
 :-[ Doh! Thank you - that fixes it, I now have Pelles C with SDL without any mixing of files. First post edited to summarise the steps required should anyone else need a hand with this. :D

Paul

Title: Re: Setting Up SDL
Post by: PaulR on August 17, 2012, 12:21:05 PM
I've created a thread that contains simple instructions and just the essential files to get SDL up and running for 32 bit Windows here:

http://forum.pellesc.de/index.php?topic=4707.0

No compilation is required, the necessary *.lib has already been compiled using Pelles C for you :D
Title: Re: Setting Up SDL
Post by: Ilya83 on April 04, 2020, 09:15:08 AM
Quote
I've created a thread that contains simple instructions

Thank you!
Title: Setting Up SDL2.0
Post by: rc30906 on February 15, 2021, 08:30:01 PM
Has anyone set up SDL in Pelles C recently and gotten it to work? I'm talking Pelles 10 and SDL2.

Thanks,
Bruce