Added debug output when dynamic library load fails

This commit is contained in:
Elias Naur 2003-05-11 11:51:08 +00:00
parent 8ae528efe0
commit fd75f7a959

View file

@ -3277,11 +3277,19 @@ int extgl_Initialize()
int extgl_Open()
{
lib_gl_handle = dlopen("libGL.so.1", RTLD_LAZY | RTLD_GLOBAL);
if (lib_gl_handle == NULL)
if (lib_gl_handle == NULL) {
#ifdef _DEBUG
printf("Error loading libGL.so.1: %s\n", dlerror());
#endif
return 1;
}
lib_glu_handle = dlopen("libGLU.so.1", RTLD_LAZY | RTLD_GLOBAL);
if (lib_glu_handle == NULL)
if (lib_glu_handle == NULL) {
#ifdef _DEBUG
printf("Error loading libGLU.so.1: %s\n", dlerror());
#endif
return 1;
}
return 0;
}
@ -3323,6 +3331,7 @@ int extgl_Open(void)
void extgl_Close(void)
{
#ifdef _X11
printf("closing handles\n");
dlclose(lib_glu_handle);
dlclose(lib_gl_handle);
#endif