Jump to content
  • Advertisement
Sign in to follow this  
wwybj

OpenGL GLEW Linking Problem(GLSL)

This topic is 3737 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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!

Share this post


Link to post
Share on other sites
Advertisement
If you are linking against with glew32.lib, it is probably because it is for VC++. You should recompile glew for your own compiler.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!