FreeGLUT链接选项

时间:2013-05-14 08:16:42

标签: c++ opengl compilation glut

我用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文件夹

enter image description here

0 个答案:

没有答案