Thanks for making GLFW, I’ve been using it for a while in my application, but recently it stopped working and throws an exception on the first call to glfwCreateWindow. I made a simpler program and it works fine there so I know my OS (Ubuntu 20.14) and X11/GPU driver stack are good (mesa/Intel Iris). There are too many moving parts for me to identify what’s changed since I last tried it. I downloaded and compiled the GLFW code in debug and found that it dies here: glXQueryExtensionsString(_glfw.x11.display, _glfw.x11.screen);
display is a valid pointer and screen is zero. Gdb stack indicates that _dlopen was called and exception thrown. I had to add the -ldl library to link with the GLFW source.
I even moved the window creation to the main thread after reading your FAQs.
Here’s the GLFW code I use:
static GLFWwindow* _win;
// now called from main thread
bool ret = glfwInit ();
_win = glfwCreateWindow (640, 480, “Display”, NULL, NULL);
Here’s the compile options:
/usr/bin/gcc -g -fPIC -fno-rtti -Wno-long-long -Wno-multichar -Wno-format-security -Wno-endif-labels -Wno-narrowing -m64 -MMD -fno-exceptions -DNULL=0 -D__STL_USE_NEW_IOSTREAMS -D__STL_NO_EXCEPTION_HEADER -D__STL_NO_BAD_ALLOC -DCUSTOM_EXCEPTIONS -L/home/dev003/GLFW/glfw/src -Wl,–hash-style=gnu -Wl,–as-needed -lglfw3 -lGL -ldl -lm -lstdc++ -lpthread -lrt
I’ve been stuck on this for days, please help.