GlewInit() in openGL

glewopengl

I have got quite strange error in my OpenGL game. I would like to use shaders, however I can't include glew.h file.

I have got included glew.h before glut.h and in my init function I wrote only glewInit() to simply initialize glew. Now, I have got error:

Error 14 error LNK2019: unresolved external symbol _glewInit referenced in function "public: void __thiscall CGL::init(void)" (?init@CGL@@QAEXXZ) gl.obj

and telling the truth I have got no idea what is wrong. I have got in my project folder glew32.libb, glew32.dll and glew.h so I have no more files to include into folder.

Can anyone help me with that?

Best Answer

If by putting #pragma comment (lib, "glew32.lib") in your main.cpp/c file everything works, then it means you didn't put glew32.lib file correctly in your Linker library list in project settings.

It's described here: http://msdn.microsoft.com/en-us/library/ba1z7822.aspx

Related Topic