Я пытаюсь запустить hello.c из красной книги на MAC OS X Lion.Я попытался установить GLUT с помощью "sudo port install glut", но получил сообщение: Ошибка: glut был заменен на mesa;пожалуйста, установите вместо этого mesa.
Итак, я установил mesa вместо этого.Тем не менее, я до сих пор не могу скомпилировать 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 не содержит тот же заголовочный файл?