Next: Building the source, Previous: Initialization, Up: Preparation
It is often desirable to check that the version of the library used is indeed one which fits all requirements. Even with binary compatibility new features may have been introduced but due to problem with the dynamic linker an old version is actually used. So you may want to check that the version is okay right after program startup.
req_version: version string to compare with, or NULL.
Check library version.
See
GSASL_VERSION
for a suitablereq_version
string.Return value: Check that the the version of the library is at minimum the one given as a string in
req_version
and return the actual version string of the library; return NULL if the condition is not met. IfNULL
is passed to this function no check is done and only the version string is returned.
The normal way to use the function is to put something similar to the
following early in your main
:
if (!gsasl_check_version (GSASL_VERSION)) { printf ("gsasl_check_version failed:\n" "Header file incompatible with shared library.\n"); exit(1); }