libGLU

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

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.

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.

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

-L/path/to/lib

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.

Originally posted by brifusg:
[b]Hi all,

I am installing Inventor from SGI. When compiling, I got this error:
[/b]

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.

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.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.