Fedora Linux Support Community & Resources Center
  #1  
Old 12th October 2004, 07:57 PM
Fesh Offline
Registered User
 
Join Date: Oct 2004
Posts: 7
Question Installing OpenGL for programming

Does anybody know the most painless way to install OpenGL so that I can program with it. I have got the nvidia OpenGL graphics driver installed (using yum). So now I am looking for a way to start using OpenGL in my c,c++ programs. I am very new to linux and FC2, but would really appreciate any help on how to set up my developement environment.
Reply With Quote
  #2  
Old 12th October 2004, 08:16 PM
tashirosgt Offline
Registered User
 
Join Date: Aug 2004
Posts: 3,855
A simple test is to use the command
glxinfo
to see if the openGL extensions are present in the X server.
If the extensions are present, just write a simple c program that uses openGL and try to compile it. That will reveal any problems with missing libraries etc.
__________________
"Never let the task you are trying to accomplish distract you from the study of computers."
Reply With Quote
  #3  
Old 12th October 2004, 08:25 PM
Fesh Offline
Registered User
 
Join Date: Oct 2004
Posts: 7
Hmm, I ran it and this was the output:

[fesh@server fesh]$ glxinfo
name of display: :0.0
Xlib: extension "GLX" missing on display ":0.0".
Xlib: extension "GLX" missing on display ":0.0".
Xlib: extension "GLX" missing on display ":0.0".
Error: couldn't find RGB GLX visual

visual x bf lv rg d st colorbuffer ax dp st accumbuffer ms cav
id dep cl sp sz l ci b ro r g b a bf th cl r g b a ns b eat
----------------------------------------------------------------------
Xlib: extension "GLX" missing on display ":0.0".
Xlib: extension "GLX" missing on display ":0.0".
0x21 24 tc 1 0 0 c . . 0 0 0 0 0 0 0 0 0 0 0 0 0 None
Xlib: extension "GLX" missing on display ":0.0".
Xlib: extension "GLX" missing on display ":0.0".
0x22 24 dc 1 0 0 c . . 0 0 0 0 0 0 0 0 0 0 0 0 0 None
Segmentation fault
[fesh@server fesh]$

This seems like it is bad. Can anyone help with this?
Reply With Quote
  #4  
Old 12th October 2004, 08:26 PM
Fesh Offline
Registered User
 
Join Date: Oct 2004
Posts: 7
On second thought, does this mean the nvidia OpenGL display driver is not correctly installed?
Reply With Quote
  #5  
Old 12th October 2004, 08:33 PM
Finalzone's Avatar
Finalzone Online
Community Manager
 
Join Date: Mar 2004
Location: Vancouver, Canada
Posts: 2,367
It seems that glx is missing. You can find details how to unistall Nvidia driver with 3D support enabled on http://www.fedorafaq.org/#nvidia . That assumes you won't have to change the kernel in a future other than bug fixes.
__________________
Desktop CPU: AMD Phenom II(tm) X4 Processor 940 AM2+ - Memory: 8GB DDR2-RAM - GPU: Nvidia Geforce GTX 460 v2 - OS: Fedora 18 Spherical Cow x86-64 and Windows 7 Ultimate SP1 64-bit
Laptop Toshiba Satellite C650D - OS: Fedora 19 Schrödinger's Cat (preview release) x86-64 and Microsoft Windows 7 64-bit

Last edited by Finalzone; 12th October 2004 at 08:35 PM. Reason: fixing url
Reply With Quote
  #6  
Old 12th October 2004, 08:40 PM
Fesh Offline
Registered User
 
Join Date: Oct 2004
Posts: 7
So you are saying I should uninstall the driver and re-install it?
Reply With Quote
  #7  
Old 12th October 2004, 08:45 PM
Finalzone's Avatar
Finalzone Online
Community Manager
 
Join Date: Mar 2004
Location: Vancouver, Canada
Posts: 2,367
Depending how you installed the driver (rpm or official NVidia method), I suggest to reinstall it.
__________________
Desktop CPU: AMD Phenom II(tm) X4 Processor 940 AM2+ - Memory: 8GB DDR2-RAM - GPU: Nvidia Geforce GTX 460 v2 - OS: Fedora 18 Spherical Cow x86-64 and Windows 7 Ultimate SP1 64-bit
Laptop Toshiba Satellite C650D - OS: Fedora 19 Schrödinger's Cat (preview release) x86-64 and Microsoft Windows 7 64-bit
Reply With Quote
  #8  
Old 12th October 2004, 08:45 PM
tashirosgt Offline
Registered User
 
Join Date: Aug 2004
Posts: 3,855
I don't know if loading the drivers fixes the xorg.conf file to use openGl. One thing to try is to look in your /etc/X11/xorg.conf file and see if you have something in the modules section like:

Section "Module"
Load "glx"

or if the Load "glx" line is commented out with a '#'. Uncomment the line or put it in. Then reboot (or restart the X server). Try glxinfo again.
__________________
"Never let the task you are trying to accomplish distract you from the study of computers."
Reply With Quote
  #9  
Old 12th October 2004, 09:17 PM
Fesh Offline
Registered User
 
Join Date: Oct 2004
Posts: 7
Ok, after taking a look at my xorg.conf file, the line Load "glx" is in there. Here is the listing under "Module"

Section "Module"
Load "dbe"
Load "extmod"
Load "fbdevhw"
Load "glx"
Load "record"
Load "freetype"
Load "type1"
Load "dri"
EndSection

However the line that is supposed to be changed from "nv" to "nvidia" in

Section "Device"
Identifier "Videocard0"
Driver "nv"
VendorName "Videocard vendor"
BoardName "NVIDIA GeForce 3"
EndSection

Keeps changing back to "nv" everytime i change it to "nvidia" after a reboot. This is perplexing, because that means the yum method of installing an nvidia driver apparently didn't work. Which sucks, so i'll probably try to install the official nvidia driver package after trying to undo all the damage i did with yum. Then I guess I can come back to the problem at hand which was setting up the developement environment. Any other help you could offer would be greatly appreciated, thx for helping me thus far.
Reply With Quote
  #10  
Old 12th October 2004, 09:37 PM
tashirosgt Offline
Registered User
 
Join Date: Aug 2004
Posts: 3,855
It's suprising to me that something changes your xorg.conf file while rebooting. How are you editing the file? Are you sure your changes "took" before you rebooted?

It's also strange that glxinfo says you don't have the GLX extensions but xorg.conf says to load them. Look in /var/log/Xorg.0.log and see if it reports some error about loading the glx module.
__________________
"Never let the task you are trying to accomplish distract you from the study of computers."
Reply With Quote
  #11  
Old 12th October 2004, 11:40 PM
Finalzone's Avatar
Finalzone Online
Community Manager
 
Join Date: Mar 2004
Location: Vancouver, Canada
Posts: 2,367
I had the same issue with livna Nvidia rpm until I remove it. I suspect it is this package that causes the problem as I removed it and install the official Nvidia package instead. I use kernel-source 2.6.5 and it seems the livna rpm package is optimized for kernel 2.6.7 and above that uses kernel-sourcecode.
__________________
Desktop CPU: AMD Phenom II(tm) X4 Processor 940 AM2+ - Memory: 8GB DDR2-RAM - GPU: Nvidia Geforce GTX 460 v2 - OS: Fedora 18 Spherical Cow x86-64 and Windows 7 Ultimate SP1 64-bit
Laptop Toshiba Satellite C650D - OS: Fedora 19 Schrödinger's Cat (preview release) x86-64 and Microsoft Windows 7 64-bit
Reply With Quote
  #12  
Old 13th October 2004, 08:13 AM
Fesh Offline
Registered User
 
Join Date: Oct 2004
Posts: 7
Well, after completely re-formatting and re-installing Fedora Core 2, this is what I did ( like to start with a clean slate )

As root, I
Downloaded the newest driver file from nvidia's website
Folllowed the instructions in the driver file readme (exiting x, installing driver, editing xorg.conf , etc.)

Ok cool, at this point openGL drivers were kicken, I played chromium to test them out and it ran great.

By downloading the nvidia openGL driver and successfully installing it, GL.h and GLU.h and respective lib files were acquired.

But how was I supposed to get the almighty GLUT?? Well, turns out yum works pretty good for some things, this is one of those cases. As root, at the command line just type "yum install freeglut-devel" this will install freeglut developer package which contains glut.h and appropriate libs. So at this point you have all the necessary headers and libs. Most Excellent

One more thing, please please please! Don't forget to use the command line switch "-lglut" when you run gcc or else your nifty new openGL app won't link right. I must have bashed my head on the keyboard for 3 hours trying to figure out why my source files would compile fine but then when it came time to link everything and build the executable it kept giving me an "undefined reference" error for every glut/gl call that was made. Just use "-lglut" to tell it you are using the glut library and it should compile and link up no problem.

Eg: $ gcc -lglut src.cpp -o src.exe

Anyways, thats what I did, hopefully this will be helpful to somebody who is having similar issues. Thanks to tashirosgt and Finalzone for the feedback.
Reply With Quote
Reply

Tags
installing, opengl, programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Help installing Installing nVidia Drivers and 32bit OpenGL Jeff91 Installation and Live Media 3 25th August 2009 12:25 AM
programming OpenGL and C++ HayZam Using Fedora 1 18th September 2008 11:47 AM
opengl window not having title bar-using freeglut for opengl programming in c++ ashjas Programming & Packaging 7 22nd January 2008 12:45 AM
Problems Installing Fedora, openGL ClintD Installation and Live Media 6 13th April 2007 09:32 PM


Current GMT-time: 19:19 (Thursday, 23-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat