Why am I getting these errors?
error: 'GL_VERTEX_SHADER' was not declared in this scope
error: 'glCreateShader' was not declared in this scope
Code:
GLuint vs = glCreateShader(GL_VERTEX_SHADER);
And yes, I do have the includes to glut.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
What does
glGetString(GL_VERSION)return?CreateShaderis not in GLUT but OpenGL 2.0. If your “includes to glut” are not includinggl.hfor some reason or your GL version is less than 2.0, the headers will not declare it.I’d also check your
gl.hto see ifCreateShaderis actually declared there.Edit: This OpenGL header version thing seems to be a general problem in Windows. Most people suggest using GLEW or another extension loader library to get around it.