#include <dlfcn.h> int dlclose (void *handle);
This function closes a dynamic module loaded with dlopen (see section dlopen). The memory is freed and all pointers into that image become invalid.
dlopen
Returns 0 on success, non-zero value on failure. More detailed error information can be obtained using dlerror (see section dlerror).
dlerror