[GRASSLIST:3300] regarding configure Problem with glBegin and Mesa

Hi,
I emailed the list about a problem with the configure script for 5.0.3.
I have the latest Mesa library(6.0 something) and when I run the configure script I get the message that it can't find the openGL library. In particular, it can't
find glBegin. I checked libGL.so.1 and it does have glBegin (using nm -d the/library | grep glBegin). I took Glynn's advice and looked at the config.log and this is what
the last couple of lines were:
configure:9400: gcc -E -I/usr/X11R6/include/ conftest.c >/dev/null 2>conftest.out
configure:9392: checking for GL/glu.h
configure:9400: gcc -E -I/usr/X11R6/include/ conftest.c >/dev/null 2>conftest.out
configure:9434: checking for location of OpenGL library
configure:9461: checking for glBegin in -lGL
configure:9478: gcc -o conftest -g -O2 -L/usr/lib conftest.c -lGL -L/usr/X11R6/lib -lSM -lICE -lX11 -lm 1>&5
/usr/bin/ld: cannot find -lGL
collect2: ld returned 1 exit status
configure: failed program was:
#line 9467 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply. */
char glBegin();

int main() {
glBegin()
; return 0; }
configure:9497: checking for glBegin in -lGL
configure:9514: gcc -o conftest -g -O2 -L/usr/lib conftest.c -lGL -L/usr/X11R6/lib -lSM -lICE -lX11 -lm -lpthread 1>&5
/usr/bin/ld: cannot find -lGL
collect2: ld returned 1 exit status
configure: failed program was:
#line 9503 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply. */
char glBegin();

int main() {
glBegin()
; return 0; }
int main() {
glBegin()
; return 0; }
configure:9497: checking for glBegin in -lGL
configure:9514: gcc -o conftest -g -O2 -L/usr/lib conftest.c -lGL -L/usr/X11R6/lib -lSM -lICE -lX11 -lm -lpthread 1>&5
/usr/bin/ld: cannot find -lGL
collect2: ld returned 1 exit status
configure: failed program was:
#line 9503 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply. */
char glBegin();

int main() {
glBegin()
; return 0; }

I don't understand what is the problem accept that the configure
script isn't finding the libGL.so.1. Does "confdefs.h" have anything to do with my
problem or is the latest Mesa library too new? Should I go for an older version of Mesa?

Thanks for your help.

Mike

Michael Salisbury wrote:

I emailed the list about a problem with the configure script for 5.0.3.

I have the latest Mesa library(6.0 something) and when I run the
configure script I get the message that it can't find the openGL
library. In particular, it can't find glBegin. I checked libGL.so.1
and it does have glBegin (using nm -d the/library | grep glBegin). I
took Glynn's advice and looked at the config.log and this is what
the last couple of lines were:

configure:9400: gcc -E -I/usr/X11R6/include/ conftest.c >/dev/null 2>conftest.out
configure:9392: checking for GL/glu.h
configure:9400: gcc -E -I/usr/X11R6/include/ conftest.c >/dev/null 2>conftest.out
configure:9434: checking for location of OpenGL library
configure:9461: checking for glBegin in -lGL
configure:9478: gcc -o conftest -g -O2 -L/usr/lib conftest.c -lGL -L/usr/X11R6/lib -lSM -lICE -lX11 -lm 1>&5
/usr/bin/ld: cannot find -lGL

I don't understand what is the problem accept that the configure
script isn't finding the libGL.so.1. Does "confdefs.h" have anything
to do with my problem or is the latest Mesa library too new? Should
I go for an older version of Mesa?

1. There needs to be a file (or a symlink to one) called "libGL.so",
without any trailing version number. If you installed Mesa from a
package (e.g. RPM), you may need to install the corresponding
development package (on RedHat it's called "Mesa-devel").

2. Is libGL.so in /usr/local/lib? If so, you need to add the switch:

  --with-opengl-libs=/usr/local/lib

to the configure command.

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

I emailed the list about a problem with the configure script for
5.0.3. I have the latest Mesa library(6.0 something) and when I run
the configure script I get the message that it can't find the openGL
library. In particular, it can't find glBegin. I checked libGL.so.1
and it does have glBegin (using nm -d the/library | grep glBegin). I
took Glynn's advice and looked at the config.log and this is what the
last couple of lines were:

configure:9400: gcc -E -I/usr/X11R6/include/ conftest.c >/dev/null
2>conftest.out configure:9392: checking for GL/glu.h

[...]

configure:9497: checking for glBegin in -lGL
configure:9514: gcc -o conftest -g -O2 -L/usr/lib conftest.c -lGL
-L/usr/X11R6/lib -lSM -lICE -lX11 -lm -lpthread 1>&5/usr/bin/ld:
cannot find -lGL collect2: ld returned 1 exit status

[...]

I don't understand what is the problem accept that the configure
script isn't finding the libGL.so.1. Does "confdefs.h" have anything
to do with my problem or is the latest Mesa library too new? Should I
go for an older version of Mesa?

[Debian 3.0 (Woody)]

$ apt-file search libGL.so.1
mesag3: usr/lib/libGL.so.1
mesag3: usr/lib/libGL.so.1.4.500
mesag3+ggi: usr/lib/libGL.so.1
mesag3+ggi: usr/lib/libGL.so.1.4.500
mesag3-glide2: usr/lib/libGL.so.1
mesag3-glide2: usr/lib/libGL.so.1.4.500
nvidia-glx: usr/lib/libGL.so.1
nvidia-glx: usr/lib/libGL.so.1.0.5336
nvidia-glx: usr/lib/nvidia/libGL.so.1.0.5336
xlibmesa-gl: usr/X11R6/lib/libGL.so.1
xlibmesa-gl: usr/X11R6/lib/libGL.so.1.2
xlibmesa-gl: usr/lib/libGL.so.1
xlibmesa-gl: usr/lib/libGL.so.1.2
xlibmesa-gl-dbg: usr/X11R6/lib/debug/libGL.so.1
xlibmesa-gl-dbg: usr/X11R6/lib/debug/libGL.so.1.2
xlibmesa-gl-dbg: usr/lib/debug/libGL.so.1
xlibmesa-gl-dbg: usr/lib/debug/libGL.so.1.2

Install the xlibmesa-gl-dev and xlibmesa-glu-dev debian packages and
then it should work.

Hamish