[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

Related Posts

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注