Jump to content
  • Advertisement
Sign in to follow this  
supagu

OpenGL compiling opengl /w codeblocks on linux

This topic is 4703 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

im a linux newb, but wanna compile my opengl app on linux. Problem is my codeblocks project cant find gl/gl.h how am i supposed to set up the includes/libs for my project to find this? i searched my drive and it came up with gl/gl.h in some nnvidia folder which is not good! i would have expected it in some non-driver specific location like one tut said it should be in usr/include/gl which doesnt exist :-/ do i need so install some package for this or something?

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by supagu
im a linux newb, but wanna compile my opengl app on linux. Problem is my codeblocks project cant find gl/gl.h

how am i supposed to set up the includes/libs for my project to find this?

i searched my drive and it came up with gl/gl.h in some nnvidia folder which is not good! i would have expected it in some non-driver specific location like one tut said it should be in usr/include/gl which doesnt exist :-/

do i need so install some package for this or something?


Linux distributions don't necesseraly come with OpenGL libraries by default (like windows). Possible sources are: MESA for a non-accelerated OpenGL implementation or the driver by the vendor of your graphics card for hardware accelerated OpenGL.

Did you install the nvidia drivers yourself? Perhaps someone chose to install them into that nvidia directory, rather than the usual dirs. In that case it should work fine all the same. If you want them to be in usr/include and usr/lib then you should probably just download the current driver from www.nvidia.com. Getting latest driver is probably a good idea anyway.

Tom

Share this post


Link to post
Share on other sites
You can copy the headers in nVidias folder (was this in /usr/share/doc/NVIDIA.. ?) to /usr/include/GL/ safely.
the library libGL.so is already installed to /usr/lib/ by nVidias installer.

Because linux (and unix) has case-sensitive file-system, you have to use "GL/gl.h", not "gl/gl.h". Linux sees those two as different paths.

ch.

Share this post


Link to post
Share on other sites
I also plan to start using Linux soon, and this might be important, so I'll put in a question here (which will probably useful for the OP, so I didn't start a new thread).

Tom, you said that the OpenGL libraries come with the video card driver. How does that work? Is there an OpenGL SDK or something related to the video card I'm using? My driver installations on Windows have been so automatic, that I've never really noted if it copies anything to my system except the driver files. Does the driver update include libraries and if so where?

This page on opengl.org refer to a 'X server integration of GLX' which is a part of the named OpenGL distros. Does anyone know if it comes with Ubuntu? A software implementation doesn't sound attractive.

supagu, if you mind this question on your thread, I'll delete it at once, just tell me. I have a question for you too--did you compile Code::Blocks your self or did you download the binary from here?

Share this post


Link to post
Share on other sites
There is no gl/gl.h

What you're looking for is GL/gl.h

As the filesystem is case sensitive, you should use the correct capitalisation.

Mark

Share this post


Link to post
Share on other sites
Quote:
Original post by deavik
I also plan to start using Linux soon, and this might be important, so I'll put in a question here (which will probably useful for the OP, so I didn't start a new thread).

Tom, you said that the OpenGL libraries come with the video card driver. How does that work? Is there an OpenGL SDK or something related to the video card I'm using? My driver installations on Windows have been so automatic, that I've never really noted if it copies anything to my system except the driver files. Does the driver update include libraries and if so where?


With windows, the OpenGL 1.1 headers and dll are included. Without a vendor driver, this dll will handle all calls as best as it can, but when a driver is available, it will forward calls there to better utilize hardware. Since both dll and headers are only 1.1, using more recent gl-functions requires all this extension horror (that is solved by GLEW, etc).

On linux, no such hack is required. If no headers or libraries exist, the vendor driver can put the most recent gl headers and .so in the normal place (/usr/include/GL/gl*.h and /usr/lib/libGL.so). If they do exist, multiple dlls can co-exist: /usr/lib/libGL.so is usually a soft link to the actual library (for example /usr/lib/libGL.so.1.0.7174). Not all drivers install the headers, but if they do they'll probably overwrite any existing headers if these are of a lower version. With the most recent driver+headers installed, there should be no need for any extension loading on linux.

Quote:
Original post by deavik
This page on opengl.org refer to a 'X server integration of GLX' which is a part of the named OpenGL distros. Does anyone know if it comes with Ubuntu? A software implementation doesn't sound attractive.

I have no idea, but from the looks of this google query it doesn't seem to be the case.

Tom

EDIT: and case sensitivity might indeed be the most likely cause of the missing headers. Most linux distributions come with at least some form of OpenGL headers in /usr/include/GL.

Share this post


Link to post
Share on other sites
Quote:
Original post by dimebolt
...

Thans Tom, that was very helpful. And, if there are any (would-be) Ubuntu users reading this, the Ubuntu website and their wiki is a mine of information. Take a look at this page for instance--there is a specific package you have to install (nvidia-glx-dev) that supposedly gets you the headers and libraries required.

Looking forward to GLX! [smile]

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!