-------------------
My system is running on Redhat 8.0
I don't know how to solve this. Pls help me out. Thanks

09-29-2003, 02:39 AM

The undefined references seems to be to some basic functions that gcc should link include.

Are you using some experimental version of the compiler?
Does it built other C++ programs correctly?
Are you using g++ or c++ and not gcc or cc?

You can also try to move -lGLU to be the first library in the command line.

brifusg

09-29-2003, 05:13 AM

Yeah, adding -lGLU will work. But is there any way to let gcc, which is the compiler I use, know where to find GLU lib?
my gcc is 3.2-7, on redhat 8.0.

jmg

09-29-2003, 08:45 AM

But is there any way to let gcc, which is the compiler I use, know where to find GLU lib?

-L/path/to/lib

09-29-2003, 03:00 PM

Yes, but the GLU library is already found otherwise would it not work at all. The problem is probably the linking order. The correct order is to have the highest level libraries first. This is the opposite to the order in a C/C++ program so many people is using the wrong order. In most cases does it work anyway but not always.

m2

10-01-2003, 01:54 AM

Originally posted by brifusg:
Hi all,

I am installing Inventor from SGI. When compiling, I got this error:

Widely used GLU implementations on modern Linux distributions consist of a library with a C interface but implemented using C++. This means you have to use c++ instead of cc to *link* your programs, if they link against libGLU. In plaintext, instead of

$ cc -o your_program ... -lGLU ...

use

$ c++ -o your_program ... -lGLU ...

HTH.

10-04-2003, 01:33 PM

I cant imagine that anyone would break GLU with purpose. If you know any distribution with the C++ requirement should you send a bug report.