SDL_GetVersion -- Get the version of SDL that is linked against your program.
#include "SDL_version.h" void SDL_GetVersion (SDL_version* ver);
SDL_GetVersion gets the version of SDL that is linked against your program.
If you are using a shared library (DLL) version of SDL, then it is possible that it will be different than the version you compiled against.
This is a real function; the macro SDL_VERSION tells you what version of SDL you compiled against.
This is a void function and returns nothing.
Note: This function may be called safely at any time, even before SDL_Init().
1 SDL_version compiled; 2 SDL_version linked; 3 4 SDL_VERSION(&compiled); 5 SDL_GetVersion(&linked); 6 printf("We compiled against SDL version %d.%d.%d ...\n", 7 compiled.major, compiled.minor, compiled.patch); 8 printf("But we linked against SDL version %d.%d.%d.\n", 9 linked.major, linked.minor, linked.patch);