GLEW Linking Problem(GLSL)
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!
If you are linking against with glew32.lib, it is probably because it is for VC++. You should recompile glew for your own compiler.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement