Next: Multi-Threading, Previous: Building sources using Automake, Up: Preparation
Before the library can be used, it must initialize itself. This is
achieved by invoking the function gcry_check_version described
below.
Also, it is often desirable to check that the version of Libgcrypt 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 may actually be used. So you may want to check that the version is okay right after program startup.
The function
gcry_check_versioninitializes the sub-systems used by Libgcrypt and must be invoked before any other function in the library, with the exception of theGCRYCTL_SET_THREAD_CBScommand (called via thegcry_controlfunction), see See Multi-Threading.Furthermore, this function returns the version number of the library. It can also verify that the version number is higher than a certain required version number req_version, if this value is not a null pointer.