I cannot get a minimal program based on GLEW, GLX, xlib and OpenGL to work.
If I don’t create a GLX/OpenGL context, glewInit() returns an error (no OpenGL version).
If I try to create a GLX/OpenGL context before calling the glewInit() function, the program blows up in glXCreateContext(). Specifically, my code calls the glXCreateContext() function, but that function terminates/exits the application and never returns.
I’m at a loss at this point. My code is based upon other code I’ve found on the OpenGL wiki and elsewhere, and is very simple. Also note that my large program from which this minimal piece was extracted was running fine until I switched from GLEE to GLEW (because GLEE has fallen behind and I need at least OpenGL v3.20).
Also note that I compile glew.c into my program rather than mess with libraries and such.
I am developing this application on CodeBlocks on the 64-bit version of ubuntu v10.04 (but compiling a 32-bit mode app).
I attach a ZIP file that contains all the files, including the CodeBlocks workspace/project file, which makes it easy to load and test if you have CodeBlocks on linux.
Any ideas? This should work, but doesn’t.
OS: ubuntu v10.04 : 64-bit version
IDE: Code::Blocks w/GNU compilers
CPU: AMD Phenom II x4 + 16GB RAM
GPU: nvidia GTX9600