Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

How should we count/package SDL2?

A topic by Apple Pie Forge created Apr 23, 2023 Views: 261 Replies: 3
Viewing posts 1 to 3

I see SDL2 is suggested in the links at the bottom, and it looks super promising with a hello world executable hitting 64k or so. 


However, it doesn't ship by default with either Windows or Ubuntu, and I see a minimum of 3MB for the library. Is this expected? Is there a better way to build on SDL2, or is it somehow not being counted?

Host (3 edits) (-1)

If you static link it, the linker should exclude the unused parts. Additional compiler flags might be necessary, it's your job to investigate that :-P

If you join our discord, some people might be able to help you with that.

Thanks for the response. I'm avoiding static linking because the authors discourage it and purposefully don't document how.

For those who might be interested, the smallest I could get a dynamic link of only the dependencies not out-of-box on Ubuntu 22 was just under 2MB (libsdl2 at ~1.7MB and libdecor at ~35KB).

Host(-1)

You're going to be doing a lot of things that are normally discouraged to get the size down, that's unavoidable.