GLEW Linking Problem(GLSL)

Started by
4 comments, last by wwybj 15 years, 8 months ago
Hi everyone~ I'm a newbie to GLSL. I'm learning GLSL from www.lightinghouse3d.com and there's a tutorial about GLSL. Link is here: http://www.lighthouse3d.com/opengl/glsl/index.php?oglexample1 I have downloaded the demo source files from that site(at the bottom of the page that I pasted up). I have glew32.lib glew32.dll glew32s.lib and glew.h in the right place. My IDE is Code::Blocks and I added glew32.lib in the Liker. But when I built this project,I got many link errores. They are all about the OpenGL 2.0 functions. My GPU card is nVidia GeForce 9600GT and the driver is updated. Error information is pasted below: obj\Debug\ogl.o||In function `_Z10setShadersv':| F:\Projects_OpenGL\GPU\ogl.cpp|74|undefined reference to `__imp____glewCreateShader'| F:\Projects_OpenGL\GPU\ogl.cpp|75|undefined reference to `__imp____glewCreateShader'| F:\Projects_OpenGL\GPU\ogl.cpp|76|undefined reference to `__imp____glewCreateShader'| F:\Projects_OpenGL\GPU\ogl.cpp|86|undefined reference to `__imp____glewShaderSource'| F:\Projects_OpenGL\GPU\ogl.cpp|88|undefined reference to `__imp____glewShaderSource'| F:\Projects_OpenGL\GPU\ogl.cpp|89|undefined reference to `__imp____glewShaderSource'| F:\Projects_OpenGL\GPU\ogl.cpp|93|undefined reference to `__imp____glewCompileShader'| F:\Projects_OpenGL\GPU\ogl.cpp|94|undefined reference to `__imp____glewCompileShader'| F:\Projects_OpenGL\GPU\ogl.cpp|95|undefined reference to `__imp____glewCompileShader'| F:\Projects_OpenGL\GPU\ogl.cpp|97|undefined reference to `__imp____glewCreateProgram'| F:\Projects_OpenGL\GPU\ogl.cpp|98|undefined reference to `__imp____glewAttachShader'| F:\Projects_OpenGL\GPU\ogl.cpp|99|undefined reference to `__imp____glewAttachShader'| F:\Projects_OpenGL\GPU\ogl.cpp|100|undefined reference to `__imp____glewAttachShader'| F:\Projects_OpenGL\GPU\ogl.cpp|102|undefined reference to `__imp____glewLinkProgram'| F:\Projects_OpenGL\GPU\ogl.cpp|103|undefined reference to `__imp____glewUseProgram'| ||=== Build finished: 15 errors, 7 warnings ===| The .cpp souce file could be downloaded from http://www.lighthouse3d.com/opengl/glsl/index.php?oglexample1 (at the bottom, "A complete GLUT example is available: OpenGL 2.0 syntax") I'm so confused about this... So... Thanks all!
Advertisement
By the way, my OS is Vista Home Premium SP1.
If you are linking against with glew32.lib, it is probably because it is for VC++. You should recompile glew for your own compiler.
Sig: http://glhlib.sourceforge.net
an open source GLU replacement library. Much more modern than GLU.
float matrix[16], inverse_matrix[16];
glhLoadIdentityf2(matrix);
glhTranslatef2(matrix, 0.0, 0.0, 5.0);
glhRotateAboutXf2(matrix, angleInRadians);
glhScalef2(matrix, 1.0, 1.0, -1.0);
glhQuickInvertMatrixf2(matrix, inverse_matrix);
glUniformMatrix4fv(uniformLocation1, 1, FALSE, matrix);
glUniformMatrix4fv(uniformLocation2, 1, FALSE, inverse_matrix);
That make sence~ Let me try. Thank u very much!
Solved~~ Thank you very much!
I compiled GLEW by MinGW and MSYS. Then I got to lib files: libglew32.a libglew32.dll.a and a dynamic lib: glew32.dll. libglew32.a is for dynamic and libglew32.dll.a is for static.

This topic is closed to new replies.

Advertisement