AFAIK, there is no such cross-platform implementation of a function to retrive the version info, yet.

The current way would be simply having a variable or constant on your program that holds a hard-coded value, or maybe a value read from a file.