Advertisement

GCC undefined functions on keywords

Started by May 04, 2005 02:01 PM
10 comments, last by Fruny 19 years, 4 months ago
I keep getting undefined function messages on compilation with key words such as new and delete. Looks like the compiler is getting its C and C++ confused am I right? How do I stop it? Thanks Traiger
use g++ or change your source files extension to .cpp
Advertisement
I need the Glu libray file. I have the header but not the library odd.

Does anyone know where I can get it. !google
g++ -lGL -lGLU yourfile.cpp

That should do it.
SlimDX | Ventspace Blog | Twitter | Diverse teams make better games. I am currently hiring capable C++ engine developers in Baltimore, MD.
Quote: Original post by Promit
g++ -lGL -lGLU yourfile.cpp

That should do it.


g++ -lopengl32 -lglu32 yourfile.cpp

if in Windows. [smile]
I'm in Linux.

The Glu file isn't anywhere so there is little point in trying to link to it which is -lGlu on Linux.

To top it of I found a Glu rpm and managed to kill my KDE installation when I used it grrr.
Advertisement
It's not Glu, but GLU. Case-sensitive, remember? Look for /usr/lib/libGLU.so. On my system, it came with the NVidia modules.
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan
Thanks Frunny I'll check that lot out.

I just got KDE to work again it seems it requires MesaGLU
This what I get when I make lesson 2, the Linux SDL version.


[paul@localhost lesson02]$ make
gcc -Wall -ansi lesson02.c -o lesson02 -lGL -lGLU `sdl-config --cflags --libs`
/usr/bin/ld: cannot find -lGLU
collect2: ld returned 1 exit status
make: *** [all] Error 1
[paul@localhost lesson02]$

Any ideas?

Thanks

Paul
If I were you, I would try to install the most recent driver for the video card. Without the driver Linux does not use hardware acceleration.
Anyway if you have a /usr/lib/libGLU.so, run /sbin/ldconfig as a root, and (I think) it will register /usr/lib/libGLU.so.
You can also use makefiles that come with the SDL version of the tutorials. Just change the filenames in the makefile, and run make.

Lutyo

This topic is closed to new replies.

Advertisement