The following constants are defined in wxWidgets:
For example, the values or these constants for wxWidgets 2.1.15 are 2, 1 and 15.
Additionally, wxVERSION_STRING is a user-readable string containing the full wxWidgets version and wxVERSION_NUMBER is a combination of the three version numbers above: for 2.1.15, it is 2115 and it is 2200 for wxWidgets 2.2.
Include files
<wx/version.h> or <wx/defs.h>
bool wxCHECK_VERSION(major, minor, release)
This is a macro which evaluates to true if the current wxWidgets version is at least major.minor.release.
For example, to test if the program is compiled with wxWidgets 2.2 or higher, the following can be done:
wxString s; #if wxCHECK_VERSION(2, 2, 0) if ( s.StartsWith("foo") ) #else // replacement code for old version if ( strncmp(s, "foo", 3) == 0 ) #endif { ... }