Below shown is the code snippet i am using. Should I allocate space using malloc before doing dlopen?
void* pvHandle = NULL;
/* Dynamically loading library */
pvHandle = dlopen ("libame.so", RTLD_LAZY | RTLD_GLOBAL);
if (!pvHandle)
{
pszError = dlerror();
cout << "Error : " << pszError;
}
Please help me clear this doubt. Thanks in Advance.
No, dlopen
returns an opaque handle to the library, you do not need to allocate any memory yourself.