How can I get the OpenGL libraries for linux....?

I just installed Linux, and I’ve already tried out the gnu c compiler. My Distribution is Mandrake Linux. By reading an OpenGL tutorial, I got to know, that I have to install the OGL libraries… My Question is: Where are these libraries available, and how can I install them?

I thank you for every answere…
shrp.

You alreday have Mesa installed. Mesa is a almost identical to OpenGl implementation in software.

Also you probably have an actual OpenGL implementation with your video card drivers.
type glxinfo to discover if it is installed.

With you have NVIDIA VGA… go to NVIDIA site and download their drivers… install them following the instructions provided in the site. You will have your linking to NVIDIA implementation (as fast as windows one).

to link your applications just add -lGL to your compile line.

Look in /usr/X11R6/lib. Are they already there?

The headers may be in /usr/X11R6/include/GL.

What video card are you using?

Thank you… I will try out your suggestions as far as possible. My GFXcard is ATI Rage 128 with 32 MB.

bye
shrp.

Ok: This text appears, typing “glxinfo”:

name of display: :0.0
display: :0 screen: 0
direct rendering: Yes
server glx vendor string: SGI
server glx version string: 1.2
server glx extensions:
GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_EXT_import_context
client glx vendor string: SGI
client glx version string: 1.2
client glx extensions:
GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_EXT_import_context
GLX extensions:
GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_EXT_import_context
OpenGL vendor string: VA Linux Systems, Inc.
OpenGL renderer string: Mesa DRI Rage128 20010405 Pro AGP 1x x86/MMX/3DNow!
OpenGL version string: 1.2 Mesa 3.4.2
OpenGL extensions:
GL_ARB_multitexture, GL_ARB_transpose_matrix, GL_EXT_abgr,
GL_EXT_clip_volume_hint, GL_EXT_compiled_vertex_array, GL_EXT_histogram,
GL_EXT_packed_pixels, GL_EXT_polygon_offset, GL_EXT_rescale_normal,
GL_EXT_stencil_wrap, GL_EXT_texture3D, GL_EXT_texture_env_add,
GL_EXT_texture_object, GL_EXT_texture_lod_bias, GL_EXT_vertex_array,
GL_MESA_window_pos, GL_MESA_resize_buffers, GL_NV_texgen_reflection,
GL_PGI_misc_hints, GL_SGIS_pixel_texture, GL_SGIS_texture_edge_clamp
glu version: 1.3
glu extensions:
GLU_EXT_nurbs_tessellator, GLU_EXT_object_space_tess

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

0x23 24 tc 0 24 0 r y . 8 8 8 0 0 24 0 0 0 0 0 0 0 None
0x24 24 tc 0 24 0 r y . 8 8 8 0 0 24 8 0 0 0 0 0 0 Slow
0x25 24 tc 0 24 0 r y . 8 8 8 0 0 24 0 16 16 16 0 0 0 Slow
0x26 24 tc 0 24 0 r y . 8 8 8 0 0 24 8 16 16 16 0 0 0 Slow
0x27 24 dc 0 24 0 r y . 8 8 8 0 0 24 0 0 0 0 0 0 0 None
0x28 24 dc 0 24 0 r y . 8 8 8 0 0 24 8 0 0 0 0 0 0 Slow
0x29 24 dc 0 24 0 r y . 8 8 8 0 0 24 0 16 16 16 0 0 0 Slow
0x2a 24 dc 0 24 0 r y . 8 8 8 0 0 24 8 16 16 16 0 0 0 Slow

What does it mean??

The direction usr/X11R6/lib exists

It includes the directiories file:/usr/X11R6/lib/modules
file:/usr/X11R6/lib/X11
file:/usr/X11R6/lib/xscreensaver

and many, many files!

usr/X11R6/include does only include X11

???
THX

XFree86 uses DRI http://dri.sourceforge.net
and http://www.mesa3d.org
for its OpenGL hardware acceleration.

The status page over at the DRI site lists your card as one that has drivers available for it, so XFree86/DRI/Mesa OpenGL rendering should work just fine.

Looking at the output of your glxinfo:

> direct rendering: Yes

Yes. DRI is working.

> OpenGL version string: 1.2 Mesa 3.4.2

Yup. You’re running Mandrake 8.2. Same as me.

> What does it mean??

It means you’re chillin’ like Bob Dylan. That is to say, you should have full OpenGL-accelerated opensource drivers installed, and they seem to be working. Try tuxracer and see for yourself.

As for developing your own OpenGL programs,… do this:

cd /usr/X11R6/lib
ls libGL*

Is your libGL.so.x present? It should be. Along with libGLU as well. These are what you’ll link to when linking your own OpenGL programs.

In your /usr/X11R6/include directory, there should be a GL subdirectory containing the GL include files. This has always shown up in my Mandrake installs. If it’s not there, I’d suggest you:

  • go to the mesa3d download area at sourceforge and download the Mesa 3.4.2 files (yes, they have older versions like 3.4.2) to some temp directory in your ~.

  • su to root

  • create a GL directory in /usr/X11R6/include if it’s not there already, and

  • copy just the include files you want into /usr/X11R6/include/GL. These are gl.h and glu.h for now (I think).

Alternatively, you might use one of the Mandrake packaging tools to get some sort of mesa-dev package in place. One thing about that worries me though:

Mesa is really a 2 headed beast. It’s used in one capacity as a software-based OpenGL renderer (I think I’m using that word correctly here). This is so you can have your CPU handle OpenGL programs on a computer without a video card that has OpenGL drivers.

Mesa is also the core component of the DRI system to handle hardware acceleration with OpenGL. A corollary to this is, you can’t just upgrade Mesa on your system, because, with stand-alone Mesa, you’ll just get the software-renderer. If you want to upgrade the version of mesa on your system, you need to upgrade the whole shebang (X/DRI/Mesa) all in one shot. I’m waiting for XFree86 4.3 to come out so I can do this.

So, if you’re using the package management tools on Mandrake, just be careful that you don’t replace your nice wired-in libGL.so (with hardware OpenGL acceleration), with the software rendering one.

—John

[This message has been edited by jmg (edited 12-09-2002).]

Oh, great help, thank you! Yes I want to develope with the libraries. I downloaded the mesalib from sourceforge, éxtracted, and copied to the directory you told. But when I compiled a little c++ program, the Gnu C Compiler said this: In file included from /usr/include/c++/3.2/backward/iostream.h

I think thats a very strange path, isn’t it?
When I compiled a c-file with gcc, he said, that he couldn’t find gl.h glu.h, glut.h and some more…

So I copied GL to /usr/include/c++/3.2/ and to /usr/include/c++/3.2/backward/

but it was the same!

Is there a way to change the path, where gcc takes the libraries from?

cya
shrp

> But when I compiled a little c++ program,
> the Gnu C Compiler said this: In file
> included from /usr/include/c++/3.2/backward/iostream.h

Weird. (?) Make sure you compile C++ programs with the g++ command rather than the gcc command. If you can’t get simple “hello world” programs to compile, you surely need to fix something before movivg on to using OpenGL.

> When I compiled a c-file with gcc, he
> said, that he couldn’t find gl.h glu.h,
> glut.h and some more…

Ahh… you’ve got the male version of gcc. You obviously need the female version. :wink:

> Is there a way to change the path, where
> gcc takes the libraries from?

Tell g++/gcc
-I/usr/X11R6/include

and then have
#include GL/gl.h
#include GL/glu.h

in your source files.

> So I copied GL to /usr/include/c++/3.2/
> and to /usr/include/c++/3.2/backward/

Don’t do that. Get them out of there. :slight_smile:

from /usr/include/c++/3.2/backward/iostream.h
Weird. (?) Make sure you compile C++ programs with the g++ command rather than the gcc command. >> If you can’t get simple “hello world” programs to compile, you surely need to fix something before movivg on to using OpenGL.

I think you’re right. Can sb tell me how to install whole gcc new on my linux? And then in the right directory??

>> Ahh… you’ve got the male version of gcc. You obviously need the female version.

Sory for my bad English… I’m still learning

bye
shrp

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