PDA

View Full Version : Linux install problem



zhiw13
09-25-2003, 08:25 PM
I am using Redhat 7.1 with gcc 2.96. I installed Mesa, Mesa-devel, glut, and
glut-devel which are built by PLD and downloaded from http://rpmfind.net
zhiw@localhost[1019]:~/currentHw/csc471-->rpm -q Mesa Mesa-devel glut
glut-devel
Mesa-3.4.1-1
Mesa-devel-3.4.1-1
glut-3.7-9
glut-devel-3.7-9

I did find something like:
*****
GLAPI void GLAPIENTRY glClear( GLbitfield mask );
*******
in /usr/X11R6/include/GL/gl.h, but I still get error message like:

zhiw@localhost[1047]:~/currentHw/csc471-->g++ -I/usr/X11R6/include
skeleton.cpp
/tmp/ccjNqwCg.o: In function `display(void)':
/tmp/ccjNqwCg.o(.text+0xf): undefined reference to `glClear'
/tmp/ccjNqwCg.o(.text+0x1c): undefined reference to `glBegin'
/tmp/ccjNqwCg.o(.text+0x30): undefined reference to `glColor3f'
......

It seems I missed something, may be I do't have the object file of gl.h. The
only object files from Mesa-devel I found are
/usr/X11R6/lib/libGL.so
/usr/X11R6/lib/libGLU.so

--------------------------------------------------------------------
this is a portion of example code I used:
#include <GL/glut.h>
#include <stdio.h>
#include <stdlib.h>

void display() {

glClear(GL_COLOR_BUFFER_BIT);
glBegin(GL_POLYGON);
glColor3f(1.0, 0.0, 0.0);
-------------------------------------------------------------------------

Can anyone guess what what I missed?

Rob The Bloke
09-25-2003, 10:37 PM
yup, not linking to the opengl libs....

try compiling with -lgl -lglu flags .....

zhiw13
09-25-2003, 11:21 PM
It just said can't find it:
zhiw@localhost[1157]:~/currentHw/csc471-->gcc -I/usr/X11R6/include -lgl -lglu skeleton.cpp
/usr/bin/ld: cannot find -lgl
collect2: ld returned 1 exit status

what should I do?



Originally posted by Rob The Bloke:
yup, not linking to the opengl libs....

try compiling with -lgl -lglu flags .....

09-26-2003, 12:46 AM
Its case sensitive, try -lGL -lGLU

zhiw13
09-26-2003, 04:41 PM
I just installed glut by source code and I downloaded a Makefile and tried:

zhiw@localhost[1007]:~/currentHw/csc471-->make
gcc -Wall -I/usr/X11R6/include/ -I/usr/local/glut-3.7/include -o cube -L/usr/X11R6/lib -I/usr/local/glut-3.7/lib cube.o -lX11 -lXi -lXmu -lglut -lGL -lGLU -lm
/usr/lib/gcc-lib/i386-redhat-linux/2.96/../../../libglut.so: undefined reference to `glXBindChannelToWindowSGIX'
/usr/lib/gcc-lib/i386-redhat-linux/2.96/../../../libglut.so: undefined reference to `glXCreateContextWithConfigSGIX'
/usr/lib/gcc-lib/i386-redhat-linux/2.96/../../../libglut.so: undefined reference to `glXGetFBConfigAttribSGIX'
/usr/lib/gcc-lib/i386-redhat-linux/2.96/../../../libglut.so: undefined reference to `glXQueryChannelDeltasSGIX'
/usr/lib/gcc-lib/i386-redhat-linux/2.96/../../../libglut.so: undefined reference to `glXChannelRectSyncSGIX'
/usr/lib/gcc-lib/i386-redhat-linux/2.96/../../../libglut.so: undefined reference to `glXChannelRectSGIX'
/usr/lib/gcc-lib/i386-redhat-linux/2.96/../../../libglut.so: undefined reference to `glXQueryChannelRectSGIX'
/usr/lib/gcc-lib/i386-redhat-linux/2.96/../../../libglut.so: undefined reference to `glXGetFBConfigFromVisualSGIX'
collect2: ld returned 1 exit status
make: *** [cube] Error 1

*****
any idea?

zhiw13
09-27-2003, 08:19 AM
OK, I just get everything working. I got mess up because I installed Mesa, Mesa-devel, glut, glut-devel by rpm.

so I removed glut, glut-devel, Mesa-devel, and downloaded MesaLib and MesaDemo from www.mesa3d.org (http://www.mesa3d.org) and installed it. things work completely fine.

But I may have messed up my /usr/lib and /usr/include by copied some files on it, but whatever, as long as I can do my homework, I fix it later

so with -lglut -lGL -lGLU option, I can compile my homework.

thank you for all the help.

satan
09-27-2003, 11:30 AM
Originally posted by zhiw13:
OK, I just get everything working. I got mess up because I installed Mesa, Mesa-devel, glut, glut-devel by rpm.


The install by rpms works fine, at least if you know what you are doing. Perhaps you should have taken the rpms for Redhat and not the PLD ones. And next time you may want to ask in the Linux forum. But glad that you got it working. Have fun coding OpenGL.

zhiw13
09-27-2003, 10:11 PM
But the problem of rpm is dependence or conflict. I only got Redhat 7.1 and don't want to upgrade. so I can't install lots of software. I know I should upgrade. But Redhat 8 and Redhat 9 didn't work well enough in my IBM Thinkpad T21 laptop. I am only a student and don't have enough time to upgrade to recent software. I got lots of problems like this. Well, really have not solution.

satan
09-28-2003, 01:44 AM
No offence meant, but I think you missed the 'if you know what you are doing' part of my message. I just wanted to state that it is possible to install glut and mesa with rpm and get it working (at least it was when I was on Redhat 7.1). You should have tried to use the rpms included with Redhat 7.1 first and not the ones for a different distro. And conflict/dependency problems are mostly wrong usage and no general rpm problem. There is nothing wrong with installations from source, but for most users it is easier to just install the rpms when there is no real need to use the source.

zhiw13
09-28-2003, 03:45 PM
thank you


Originally posted by satan:
No offence meant, but I think you missed the 'if you know what you are doing' part of my message. I just wanted to state that it is possible to install glut and mesa with rpm and get it working (at least it was when I was on Redhat 7.1). You should have tried to use the rpms included with Redhat 7.1 first and not the ones for a different distro. And conflict/dependency problems are mostly wrong usage and no general rpm problem. There is nothing wrong with installations from source, but for most users it is easier to just install the rpms when there is no real need to use the source.