[GRASSLIST:4724] Re: opengl compile problem

Glynn Clements glynn.clements at virgin.net
Sun Oct 13 23:56:41 EDT 2002


Eric G. Miller wrote:

> > Thanks for the ideas, I see where you are going. Here's what I have found:
> > For 1, above, grep indicates that gluBeginCurve is present in libGLU.so
> > For 2, above, I get:
> > 
> > [rich at Moab lib]$ ldd libGLU.so
> >         libGL.so.1 => /usr/X11R6/lib/libGL.so.1 (0x4009c000)
> >         libc.so.6 => /lib/i686/libc.so.6 (0x4011b000)
> >         libpthread.so.0 => /lib/i686/libpthread.so.0 (0x4023b000)
> >         libXext.so.6 => /usr/X11R6/lib/libXext.so.6 (0x4024f000)
> >         libX11.so.6 => /usr/X11R6/lib/libX11.so.6 (0x4025f000)
> >         libdl.so.2 => /lib/libdl.so.2 (0x4032a000)
> >         /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x80000000)
> 
> Hmm, I thought libGLU was supposed to be independent of X...

The dependency is transitive; libGLU requires libGL, which requires X.

> $ ldd /usr/lib/libGLU.so
> 	libc.so.6 => /lib/libc.so.6 (0x40020000)
> 	/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x80000000)
> 
> That is mesa 3, though...

That just means that your libGLU doesn't have complete dependency
information; gcc will add the libc dependency automatically.

> > My original lib directive was:
> >         --with-opengl-libs='/usr/lib /usr/X11R6/lib'
> > So I added /lib/i686 and /lib, but unfortunately, I am getting exactly the 
> > same error:
> >         checking for location of OpenGL library...
> >         checking for glBegin in -lGL... yes
> >         checking for gluBeginCurve in -lGLU... no
> >         configure: error: *** Unable to locate GLU library.
> > 
> > Any other suggestions?
> 
> The configure directive will need -L/<paths> for each of the paths *and*
> -l<lib> for each library.  The test probably creates something like:
> 
> int main (void) {
>     int gluBeginCurve();
>     gluBeginCurve();
> }
> 
> And needs something like:
> 
> $ cc -o configtest configtest.c -L/usr/X11R6/lib -L/lib/i686 -lGL \
>    -lpthread -lXext -lX11 -ldl
> 
> There's not really any way to make that happen without hacking the
> configure script to get the additional -l<lib> arguments...

The configure test will automatically add "-lGL", which will pull in
everything that libGL requires.

As well as libGL, libGLU typically requires libm[1] and libstdc++[2].

[1] libGLU actually implements its own functions, whereas libGL either
sends requests to the X server (indirect rendering) or passes them to
the DRI module (direct rendering).

[2] At least, the SGI version (which comes with XFree86) does.

-- 
Glynn Clements <glynn.clements at virgin.net>



More information about the grass-user mailing list