Compiled OpenGL programs do nothing

I’m having a strange problem with my Linux GL. Well, not a strange problem, it just doesnt work.

I’m running Linux RedHat 8.0, with a Riva TNT card. Drivers were installed properly. When I go to compile any of the NeHe tutorials (or almost anything else), it compiles properly. However when I go to run the program, it does nothing. When I double click on the out file, nothing happens. No window, no error, nothing. Even when using the make files supplied with the NeHe tutorials, nothing happens when the app is run.

What did I do wrong? And if I do my own programs, what is the line for the compile? <is quite a newbie to Linux> Got the -lgl -lglut etc working, put still does nothing when compiled.

Originally posted by Cyrgon:
Drivers were installed properly.

Are you sure about that?
Did you follow the instructions from the README?
(ie. Adding/removing some entries to/from /etc/X11/XF86Config)

When I double click on the out file, nothing happens. No window, no error, nothing.

This ain’t Windows.
Startup a console/terminal and try starting the app from there (or look at any other window that can display messages from stderr/stdout/etc).
You’ll probably get an error about not being able to create a GLX visual blablah when you didn’t follow the steps from the README file (downloadable from the driver page at

what is the line for the compile?

When there’s a Makefile available you can just use ‘make’ to build the app.

[This message has been edited by richardve (edited 12-22-2002).]

I am pretty sure that the drivers are in properly, because other, pre-compiled programs run properly on my system.

I want to know the compile line because I want to experiment with OpenGL in Linux (I have done alot in Windows).

I’ll check the NVidia drivers again.

And when I run it in console, it gets “Cannot open display”

That will happen when the demo requests to X a windows of a pixel format that cannot be displayed. Look if you are running under 16 bit color mode… NeHe demos come programmed to high color deep. If that is the case… just change teh setup in your /etc/x11/XF86CONFIG file.

Also make sure that the data the program uses is available. I had problems with programs that didn’t find BMP files and crashed (or exited, depending on how good they were written) without saying anything.


I am also new at OpenGL, but after hours
of grisly work I have found the following to work.

  • make sure* are in /usr/lib/

  • make sure* are in /usr/lib/

  • make sure* are in /usr/lib/

  • make sure GL.h, GLU.h, glut.h, and related files are in /usr/include/GL/

  • Then compile using the following line (this should all be on one line)

g++ -lGL -lGLU -lglut /usr/X11/lib/ somefile.cpp

If you are using GLUT, you may even want to refer to this website for more help:

I hope this helps!

NeHe tutorials gave me a few headaches on my Linux box.

I found out that the pixel format they ask to GLUT is a bit nonsense:


They’re asking GLUT_RGBA and GLUT_ALPHA, which is asking twice the Alpha channel. (unless I’m not getting something)
I removed GLUT_ALPHA from that line and it worked like a charm.

btw, I was using MESA, not NVIDIA drivers.

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