In what directory do I need to install a tarball containing API libraries in order to import the libraries for programming?
[Long version]
I’ve been trying for a few hours now to get started on my homework - but I need the GLUT api for OpenGL. After attempting to compile a simple test program, I got the error
glut.h: No such file or directory
First off, I’m not even really sure if OpenGL wasn’t included in the original install or if I even need it when programming with GLUT (I truelly am clueless, lol). But after reading as much as I could, I’ve only been able to deduce that I need to install the API libraries somewhere on my disc…
So I found the tarball, and there are special instructions for installing a linux machine. I found instructions saying to install it in the directory /usr/lib/ but is that right for the SUSE distro?
Also, if anybody knows anything about GLUT/OpenGL programming + openSUSE11.2, please chim in! I’m helpless…
cd /usr/src
tar -xvzf glut-3.7.tar.gz
cd glut-3.7
Read the file: README.linux
cd linux
READ the file: README
cp Glut.cf ..
cd ..
Edit Glut.cf: remove any Mesa references.
Replace any -lMesaGL -lMesaGLU with -lGL -lGLU if needed.
In particular, replace:
OPENGL = $(TOP)/../lib/libMesaGL.so
GLU = $(TOP)/../lib/libMesaGLU.so
with:
OPENGL = -lGL
GLU = -lGLU
./mkmkfiles.imake
cd lib/glut
cp /usr/src/glut-3.7/linux/Makefile .
Edit the Makefile: remove any Mesa references.
Replace any -lMesaGL -lMesaGLU with -lGL -lGLU if needed.
In particular, replace:
OPENGL = $(TOP)/../lib/libMesaGL.so
GLU = $(TOP)/../lib/libMesaGLU.so
with:
OPENGL = -lGL
GLU = -lGLU
make
ln -s libglut.so.3.7 libglut.so
ln -s libglut.so.3.7 libglut.so.3
cp -d libglut.* /usr/lib
cd ..
cd gle
# make a shared lib for libgle
make
gcc -shared -o libgle.so.3.7 *.o
ln -s libgle.so.3.7 libgle.so
ln -s libgle.so.3.7 libgle.so.3
cp -d libgle.* /usr/lib
cd ..
cd mui
# make a shared lib for libmui
make
gcc -shared -o libmui.so.3.7 *.o
ln -s libmui.so.3.7 libmui.so
ln -s libmui.so.3.7 libmui.so.3
cp -d libmui.* /usr/lib
# Install the GLUT manual pages (not included with MesaDemos)
cd /usr/src/glut-3.7
make SUBDIRS=man Makefile
cd man/glut
make install.man
ldconfig
cd ../../progs/demos/ideas
# edit the Makefile, change OPENGL = -lGL and GLU = -lGLU
make
./ideas
# test compiling some demos
# take a look at which libraries have to be linked (-lX11 ...) in
# the Makefiles. Qt's tmake program available at www.troll.no
# is a quick way to make a Makefile but you have to edit it
# and add the -l needed.
Like I had said, when I tried to compile my program it said ‘GL/glut.h: No such file or directory.’ And when I searched for any file with ‘glut’ in the name on my computer, I got no results. I assumed that GLUT was not installed.
So the next logical step was to go and install it. When I searched with keyword ‘glut’ in YaST’s package search, I got the same results as in the link you posted. None of those seemed like what I needed (I don’t think my professor will accept freeglut or glut for haskell). So I thought that the tarball install was my only option.
But…the makefiles where just not playing nice with SUSE and I feel like if I’m going to get GLUT working on my laptop at all, it’s going to have to be one of the RPGs.
Ok, freeglut is installed on my laptop now (or already was ), but its not set up right. /usr/include/GL does not contain the necessary Mesa and glut files.
Can anybody point me in the right direction? I’m a puzzled penguin :(.
TheStallion wrote:
> But, when I try to compile, I still get the same error. Does anybody
> know if there is anything I need to do to set up the paths or something?
my guess is that your professor is attempting to get you to exercise
your problem solving and or reading skills…
coming here for easy help (in avoiding the documentation) with your
homework will do neither, and will not help you in the long term…
As mentioned above, we’re not here to do your homework, but I’ll be nice and assume your homework is about GL programming, and that you need a working GL installation.
Use YaST to install glut and glut-devel packages. The former holds the libraries, the later the header files you need. The clue (and it’s a general rule) is that for DIY programming with package ‘foo’ you also need the ‘foo-devel’ package.
I looked in the ‘files’ list for freeglut-devel in YaST:
Ok thanks! I was trying to install the freeglut packages last night (via Yast) but I’m having a problem with a media path that is terminating the process.
BTW, the homework has nothing to do with installing anything on any OS. The professor expects us to use the computer lab’s machines (which run Fedora), but I thought I’d try to save myself the 30 minute walk up the hill…