Example of how to build and link against SDL?
Garry (87) 184 posts |
Hi, Can someone provide a sort of “hello world” example how how to compile/link with SDL? I have GCC and DDE, don’t mind which I use, though I’ve used a couple of #pragma that DDE doesn’t seem to like, so maybe GCC is the way to go. Cheers Garry |
Rick Murray (539) 13840 posts |
https://github.com/libsdl-org/SDL/blob/main/docs/README-riscos.md Then, I’d imagine just link with it as usual. |
Chris Gransden (337) 1207 posts |
There’s a port of the SDL1 library (LibSDL1.2) available via PackMan.
Here’s a simple Makefile to compile and link the above example on RISC OS using GCC.
|
Garry (87) 184 posts |
Thank you Chris, this looks like exactly what I need. It never occurred to me to use make, I was planning to just have an Obey file with lots of lines in it, but this looks perfect for me. Cheers Garry |
Garry (87) 184 posts |
Chris, thanks again for this, I wasn’t able to build statically for the moment as libFLAC in Packman doesn’t seem to have a static library in there, but it works great for building against the shared libraries, and my little game attempt now runs on RISC OS! |