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>
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:
[b]yup, not linking to the opengl libs…
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.
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.
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.
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.