Get the version of SDL that is linked against your program.
void SDL_GetVersion(SDL_version * ver);
the SDL_version structure that contains the version information
If you are linking to SDL dynamically, then it is possible that the current version will be different than the version you compiled against. This function returns the current version, while SDL_VERSION() is a macro that tells you what version you compiled with.
This function may be called safely at any time, even before SDL_Init().
SDL_version compiled; SDL_version linked; SDL_VERSION(&compiled); SDL_GetVersion(&linked);"We compiled against SDL version %d.%d.%d ...\n", printf( compiled.major, compiled.minor, compiled.patch);"But we are linking against SDL version %d.%d.%d.\n", printf( linked.major, linked.minor, linked.patch);