0

我用 Ubuntu 12.04 LTS(64 位机器)开始了一个项目,我安装了 freeglut3 和 freeglut3-dev。以及使用 nVidia 的驱动程序安装程序安装的其他 gl 库(必须是 32 位库)。当我编译我的代码时,它的选项是 -lglut 和 -lGLEW。然而,事实证明

At the preprocessor
26 #include <GL/glew.h>
27 #include <GL/glut.h>

...


:~/Downloads/Homework/src$ gcc main.cpp -o homework -lGLEW -lfreeglut
main.cpp: In function ‘void calculateFPS()’:
main.cpp:296:43: error: ‘glut_ELAPSED_TIME’ was not declared in this scope
main.cpp: In function ‘void mouse(int, int, int, int)’:
main.cpp:381:14: error: ‘glut_DOWN’ was not declared in this scope
main.cpp:381:37: error: ‘glut_LEFT_BUTTON’ was not declared in this scope
main.cpp:397:14: error: ‘glut_UP’ was not declared in this scope
main.cpp:397:35: error: ‘glut_LEFT_BUTTON’ was not declared in this scope
main.cpp: In function ‘void keySelect(unsigned char, int, int)’:
main.cpp:442:49: error: ‘glutCloseFunc’ was not declared in this scope
main.cpp:448:93: error: ‘glProgramUniform1i’ was not declared in this scope
main.cpp: In function ‘int main(int, char**)’:
main.cpp:489:25: error: ‘glut_RGBA’ was not declared in this scope
main.cpp:489:37: error: ‘glut_DOUBLE’ was not declared in this scope
main.cpp:489:51: error: ‘glut_DEPTH’ was not declared in this scope
main.cpp:489:64: error: ‘glut_MULTISAMPLE’ was not declared in this scope
main.cpp:493:20: error: ‘glut_ACTION_ON_WINDOW_CLOSE’ was not declared in this scope
main.cpp:493:49: error: ‘glut_ACTION_glutMAINLOOP_RETURNS’ was not declared in this scope
main.cpp:493:82: error: ‘glutSetOption’ was not declared in this scope
main.cpp:494:28: error: ‘glutCloseFunc’ was not declared in this scope
main.cpp:496:32: error: ‘glutInitContextVersion’ was not declared in this scope
main.cpp:497:25: error: ‘glut_FORWARD_COMPATIBLE’ was not declared in this scope
main.cpp:497:49: error: ‘glutInitContextFlags’ was not declared in this scope
main.cpp:498:27: error: ‘glut_CORE_PROFILE’ was not declared in this scope
main.cpp:498:45: error: ‘glutInitContextProfile’ was not declared in this scope

我不知道为什么会这样,我附上了我的 GL 文件夹

在此处输入图像描述

4

0 回答 0