我正在尝试从 MAC OS X Lion 的红皮书中运行hello.c 。我尝试通过“sudo port install glut”安装 GLUT,但收到消息:错误:过剩已被台面替换;请改为安装台面。
所以,我安装了台面。但是,我仍然无法编译我的 hello.c。我使用以下命令进行编译:
gcc -lglut hello.c
但收到错误消息:
hello.c:47:21: error: GL/glut.h: No such file or directory
hello.c: In function ‘display’:
hello.c:53: error: ‘GL_COLOR_BUFFER_BIT’ undeclared (first use in this function)
hello.c:53: error: (Each undeclared identifier is reported only once
hello.c:53: error: for each function it appears in.)
hello.c:59: error: ‘GL_POLYGON’ undeclared (first use in this function)
hello.c: In function ‘init’:
hello.c:78: error: ‘GL_PROJECTION’ undeclared (first use in this function)
hello.c: In function ‘main’:
hello.c:93: error: ‘GLUT_SINGLE’ undeclared (first use in this function)
hello.c:93: error: ‘GLUT_RGB’ undeclared (first use in this function)
基本上它在抱怨找不到 GL/glut.h。Mesa 不包含相同的头文件吗?