环境,ubuntu 10.04
sudo apt-get install freeglut3-dev //安装OpenGL
#include <GL/glut.h>
int main()
{
gluPerspective (0,0,0,0);
}
#g++ test.cpp -o Test -lglut
test.cpp:(.text+0x2ec): undefined reference to `gluPerspective'
collect2: ld returned 1 exit status
undefined reference to “gluLookAt”
以上解决办法:
#g++ test.cpp -o Test -lglut -lGLU
链接OPenGL的库就可以了。。