Include dlerror() in handling of failed dlopen()

X11OpenGLWindow::X11OpenGLWindow() ends up calling dlopen() to get libX11.
When this fails, it only reports that it failed, and what filename it was looking for.
This commit adds dlerror() to the error message, which makes investigating failures easier.
This commit is contained in:
vabr-g 2020-02-14 15:32:40 +01:00 committed by GitHub
parent b06cdd5fc1
commit dd8fcad6d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -220,7 +220,7 @@ struct InternalData2
if (!m_x11_library)
{
// TODO: Properly handle this error.
fprintf(stderr, "Error opening X11 library %s\n", X11_LIBRARY);
fprintf(stderr, "Error opening X11 library %s: %s\n", X11_LIBRARY, dlerror());
exit(EXIT_FAILURE);
}