Search code examples
cglew

undefined reference to imp_glewInit in my c file


Now i have just started to learn graphics for rendering. I have spent a lot of errors trying to resolve this error.I have placed the glew32.dll file in system32,have placed the header files in the header files path of the devcpp,have set the path of glew32.lib and glew32s.lib from the compiler options. But still am getting "undefined reference to __imp_glewInit'" and "undefined reference to __imp_glewGetErrorString'". Please tell the error.

#include<stdio.h>
#include<glew.h>
#include<GL/gl.h>
#include<GL/glu.h>
int main()
{
    
GLenum err = glewInit();
if( GLEW_OK != err )
{
 fprintf(stderr, "Error initializing GLEW: %s\n",
 glewGetErrorString(err) );
}
    return 0;
}

Solution

  • I think you should be using the glew32.lib. I am sure this answer will help,

    https://stackoverflow.com/a/40988434/13876104