Gtk+ does have macros for determining the version number during compilation that can be used. My reasoning for defining the configuration macro is to allow developers to select the required library at configuration time. This method allows a developer/user to have both Gtk2 and Gtk3 on their system at the same time. Useful for cross compilation, or testing code that is required to compile on either version.