Use this macro to determine the SDL version your program was compiled against.
an SDL_version structure to initialize
Fills the selected struct with:
(x)->major = SDL_MAJOR_VERSION
(x)->minor = SDL_MINOR_VERSION
(x)->patch = SDL_PATCHLEVEL
SDL_version compiled; SDL_version linked; SDL_VERSION(&compiled); SDL_GetVersion(&linked); printf("We compiled against SDL version %d.%d.%d ...\n", compiled.major, compiled.minor, compiled.patch); printf("But we are linking against SDL version %d.%d.%d.\n", linked.major, linked.minor, linked.patch);
This macro fills in an SDL_version structure with the version of the library you compiled against. This is determined by what header the compiler uses. Note that if you dynamically linked the library, you might have a slightly newer or older version at runtime. That version can be determined with SDL_GetVersion() which, unlike SDL_VERSION(), is not a macro.