[Linux+OpenGL] **.c:(.text+0x1bc): undefined reference to `gluPerspective'

This isn't a header file issue. Header files are for compiling. This is a linking issue. It needs a library that contains gluPerspective. That library is libGLU.

 

Try:

g++ -Wall -o cube main.cpp imageloader.cpp -lglut -lGLU -lGL

你可能感兴趣的:(reference)