Reputation: 11904
What I have included (other than c++ standard library headers):
#include <GL/glut.h>
And my compiling command include -lGL -lGLU -lglut
However, when I compile my code, I got 'xxx' was not declared in this scope
for glGenBuffers, glBindBuffer, and all other 3.3 functions.
I tried to include a few other files such as GL3.h or glew.h, but they do no help: either the error is still there, or more errors popped up.
What am I missing to include?
Upvotes: 0
Views: 126
Reputation: 201
GLUT/FreeGLUT serve as utility libraries to create and maintain an OpenGL context bound to a certain window. However, resolving function calls to the OpenGL API requires libraries like glew. Therefore, including glew.h and linking with -lglew is the right way to go here. Could you please post the occuring errors when including glew.h?
Upvotes: 1