PDA

View Full Version : libGLU



brifusg
09-28-2003, 05:06 AM
Hi all,

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

/usr/lib/libGLU.so.1: undefined reference to `__rtti_user'
/usr/lib/libGLU.so.1: undefined reference to `__rtti_si'
/usr/lib/libGLU.so.1: undefined reference to `__throw'
/usr/lib/libGLU.so.1: undefined reference to `terminate(void)'
/usr/lib/libGLU.so.1: undefined reference to `__builtin_vec_new'
/usr/lib/libGLU.so.1: undefined reference to `__builtin_vec_delete'
/usr/lib/libGLU.so.1: undefined reference to `__rtti_class'
/usr/lib/libGLU.so.1: undefined reference to `__builtin_delete'
/usr/lib/libGLU.so.1: undefined reference to `__terminate'
/usr/lib/libGLU.so.1: undefined reference to `__builtin_new'
collect2: ld returned 1 exit status

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

09-29-2003, 01: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, 04: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, 07: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, 02: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, 12: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, 12: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.