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フォルダーを添付しました