PDA

View Full Version : OpenGL library confusion and compile problems



SparceMatrix
09-01-2002, 12:10 PM
I have made several attempts to apply programming with OpenGL using several tutorials and I am not meeting with any consistancy in either my successes or failures. My first attempt is in the chapter on OpenGL programming in "Linux Programming Unleased 2nd Ed" This chapter explains to me that I have to have the Mesa libraries in order to implement OpenGL. After some searching around I found Mesa 4.0.3 and installed that according to the Install instructions. But, the sample program in this chapter will not compile because it is missing MesaGLU (-lMesaGLU). After looking in the various include directories in my Red Hat 7.3 installation, I can't find another mesa file, MesaGL, either.

With my Mesa 4.0.3 download, there are numerous demo programs. The installation of Mesa can also compile these programs which I did. But, roughly over half of the programs do not function. They do not appear to return errors, they just never start.

I've tried some of the tutorials at nehe.gamedev.net, but the introduction does not explain how to install OpenGL in Linux. To make matters even more confusing the downloads for linux come in three different types with no explanations of what the differences are. I tried the 'Linux' download for a few of the lessons and when I compile and run the program, I get an error message, "GLUT: Fatal Error in <program name>: visual with necessary capabilities not found.

Another thing is that the demo programs I was able to get going did not seem to have hardware support because they were very sluggish. I have an nVidia card and I think I understand that OpenGL supports nVidia cards. Looking for 'Systems Supported' at the mesa3d.sourceforge.net, I was refered to yet another version of OpenGL called Utah GLX (utah-glx.sourceforge.net), but the site there advised me that I could not use it with my latest 4.0.3 version of mesa. How do I get my OpenGL libraries to support my card's hardware. I notice in my XF86Config-4 file that DRI is set to:



Section "DRI"
Mode 0666
EndSection

Is this right?

Meanwhile, I am seeing discussion elsewhere that suggest I'm not supposed to be using Mesa at all.

So what is the summary of what my OpenGL libraries are supposed to be and where do I get them, if I haven't got them already? What are the sources of all these errors? How do I get hardware support for my nVidia card?

rts
09-01-2002, 12:52 PM
http://www.nvidia.com/content/drivers/drivers.asp

Google is your friend.
http://www.google.com/search?q=nvidia+Linux+OpenGL+drivers&sourceid=mozilla-search&start=0&start=0

SparceMatrix
09-01-2002, 01:48 PM
Thanks for the link, but how is that the answer to my nVidia problem? If I thought it was a driver problem, I would have downloaded a driver. But according to my XF86Config file, I am already set up for nVidia. What am I missing that is fulfilled in the downloads there?

What about the rest? Anyone else?

[This message has been edited by SparceMatrix (edited 09-01-2002).]

SparceMatrix
09-01-2002, 02:08 PM
Another thing I have noticed is that the /lib directory is not in the Mesa 4.0.3 package that I got. The 'Readme' document says I should see that directory and I don't.

09-01-2002, 07:14 PM
rts is absolutley right. That is the summary of what your OpenGL libraries is supposed to be and where to get it. Probably do you want to download the source version because of this http://www.opengl.org/discussion_boards/ubb/Forum4/HTML/000741.html

The other stuff you are asking about should be explained on their web sites. It is different OpenGL implementations.

If you want to use GLUT from Mesa should you know that you must use a version that is older than 4.x for it to work with nvidia. NVidia has an almost complete implementation but you should also get GLU from Mesa.

OldMan
09-02-2002, 03:16 AM
Do not use mesa.. use NVIDIA GLX and NVIDIA drivers. They are much faster and much more capable.

SparceMatrix
09-02-2002, 07:52 AM
OK, I'm wrestling with the nVidia downloads now. I went through the download just to try and solve the hardware support issue.

Since I have already been through a compile with the Mesa-4.0.3 download, is there anything I need to do to clean that up? Will 'make uninstall' be OK and/or sufficient?

SparceMatrix
09-02-2002, 08:03 AM
Another thing, I am having a little differentiating drivers and libraries. To what extent are they the same thing? I understand that the nVidia drivers are prefered if I want to play Quake, for example. But if I want to compile OpenGL software with hardware support, am I getting all the right headers with the nVidia downloads?

In a few tutorials, I see the files, MesaGL and MesaGLU being necessary for linking, or something.

09-02-2002, 06:39 PM
It is not absolutley necessary to clean up after Mesa since NVidia will owerwrite and/or rename the files anyway. If you want to do it should you read the instructions from the Mesa package.

Yes, you are getting the right headers from NVidia. You need to move them to /usr/include/GL from /usr/share/doc/NVIDIA_GLX-1.0/include/GL/. I think that the Mesa libraries had the Mesa* prefix before.