I’m learning OpenGL and i have issue with just a simple triangle…
I get a link error with glGenVertexArrays et glBindVertexArray.
When i delete these 2 lines, my program has no link error.
I linked with freeglut, glew64, glew32, glew32s just in case. My program is configured as x64.
GLuint VertexArrayID;
glGenVertexArrays(1, &VertexArrayID); // ERROR HERE
glBindVertexArray(VertexArrayID); // ERROR HERE
static const GLfloat g_vertex_buffer_data[] = {
-1.0f, -1.0f, 0.0f,
1.0f, -1.0f, 0.0f,
0.0f, 1.0f, 0.0f,
};
GLuint vertexbuffer;
glGenBuffers(1, &vertexbuffer);
glBindBuffer(GL_ARRAY_BUFFER, vertexbuffer);
glBufferData(GL_ARRAY_BUFFER, sizeof(g_vertex_buffer_data), g_vertex_buffer_data, GL_STATIC_DRAW);
glEnableVertexAttribArray(0);
glBindBuffer(GL_ARRAY_BUFFER, vertexbuffer);
glVertexAttribPointer(
0, correspondre au « layout » dans le shader
3,
GL_FLOAT,
GL_FALSE,
0,
(void*)0
);
glDrawArrays(GL_TRIANGLES, 0, 3); // Démarre à partir du sommet 0; 3 sommets au total -> 1 triangle
glDisableVertexAttribArray(0);
Link errors :
error LNK2001: symbole externe non résolu __imp___glewGenVertexArrays
error LNK2001: symbole externe non résolu __imp___glewBindVertexArrays
I’m programming on VS 2013, my GC is a GTX 970 and my drivers are up to date.
I tried on a sample of CUDA and is does the same thing.
Thank you for your help !