Linking error: undefined reference to glXSwapIntervalEXT

I am trying to call glXSwapIntervalEXT in my Linux application.

I declared GLX_GLXEXT_PROTOTYPES in the user definitions, and the header file is found. However, my program cannot link due to an undefined reference to this function.

I am trying this text in the compiler options in Code::Bliocks:
-lGLEW -lglut -lGL -lGLU -lXext

I also tried adding “/usr/lib/x86_64-linux-gnu/” in the linker settings, but to no avail.

Any idea what I need to add to make this build?

This should be defined by your libGL library, not GLEW.


> nm -Do /usr/lib64/ | grep glXSwapIntervalEXT
/usr/lib64/ T glXSwapIntervalEXT

> nm -Do /usr/lib/ | grep glXSwapIntervalEXT
/usr/lib/ T glXSwapIntervalEXT

> glxinfo | grep OpenGL
OpenGL vendor string: NVIDIA Corporation
OpenGL renderer string: GeForce GTX 560 Ti/PCIe/SSE2
OpenGL version string: 4.4.0 NVIDIA 325.05.14
OpenGL shading language version string: 4.40 NVIDIA via Cg compiler
OpenGL extensions:

Are you compiling 32-bit or 64-bit? Check the appropriate library in that case.


That’s a really odd path. Why are your GLEW libs stuffed in that dir?

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.