Gene's OpenGL experiments (GOGL)

Gene Michael Stover

created Saturday, 24 May 2003
updated Saturday, 24 May 2003

Copyright © 2003 by Gene Michael Stover. All rights reserved. Permission to copy, store, & view this document unmodified & in its entirety is granted.


Contents

1 Introduction

My experiments while learning OpenGL. Probably of most use to me, the guy learning OpenGL.

2 Setup

Mesa version 4.0.3 is installed on Plague, but I installed it at least a year ago, & I'm not sure I did it right. Also, there's a newer release of Mesa, version 5.0.1. So I downloaded that from Mesa's page on Source Forge, to which I was directed by Mesa's home page.

It seems that the MesaLib-5.0.1.tar.* file is the library, but GLUT & other nearly necessary things are in the corresponding MesaDemos-5.0.1.tar.* file, so I downloaded both. They unpack into the same directory, ./Mesa-5.0.1.

Mesa uses ./configure, but to install into the standard OpenGL location, you must use --prefix=/usr; otherwise, ./configure defaults to /usr/local. So I ran ``./configure --prefix=/usr''.

Then ``make''. Then su to root to run ``make install'', but first I removed the old installation (/usr/local/include/GL/, some libraries in /usr/local/lib/, & /usr/include/GL/).

Then ``make check'' failed. Seems that it is looking for the Mesa libraries in /home/local/Mesa-5.0.1/. Truth be told, I accidentally unpacked it into that directory. I moved it to /home/local/src/Mesa-5.0.1 after the make. It uses shared libraries & libtool, which probably explain the problem. So start over:

  1. make clean

  2. ``export LDFLAGS=-lstdc++; ./configure --prefix=/usr''. The Mesa installation instructions on their web site suggested the LDFLAGS part.

  3. make

  4. make install

  5. make check

The ``make check'' fails because libGLU requires the C++ runtime, which it ain't bein' linked with. That's what the LDFLAGS= was supposed to fix according to the Mesa installation instructions.

I got the first link error to go away (temporarily) to copying the entire link command (which was huge) into a file, changing the ``gcc'' to ``g++'', removing all the -L... arguments that mentioned ``stdc++'', & removing a /usr/.../libstdc++.so. Basically, I removed all references to ``stdc++''. That single link, which I ran outside of make, worked, but when I ran ``make check'' again, it failed for the same reason. So I finally settled on ``make -k check'' in the hopes of compiling & linking what it can.

It finished after about ten minutes. Don't know what it built. I can't find any executables, though I didn't look very deep into the directories. So I think it installed the libraries, but I can't find demos to see if it works. That's one reason to have my own test & demo programs. They start simpler so it's easier to find errors.

So I tried my own test/demo programs, which is what GOGL is. I get the same link error. It's a problem in libGLU, but you have to link with libGLU. It's a problem with C++ libraries, & the fact that Silocon Graphic's GLU is written in C++ makes me suspect you always have to link it with the C++ compiler. In a worst case, it means your programs would have to be C++, which is lame, lame, lame!

Bibliography

Gene Michael Stover 2008-04-20