1

I am having the following link errors regarding glew library when compiling an opengl 2.1 program on code blocks,mingw.

obj\Debug\LUtil.o||In function `Z6renderv':|
C:\Users\war\Desktop\CG\Hello\LUtil.cpp|162|undefined reference to `_imp____glewGenBuffers'|
C:\Users\war\Desktop\CG\Hello\LUtil.cpp|163|undefined reference to `_imp____glewBindBuffer'|
C:\Users\war\Desktop\CG\Hello\LUtil.cpp|164|undefined reference to `_imp____glewBufferData'|

Also, I have properly linked these libraries. -lopengl32 -glu32 -glew32 -lfreeglut

Also, I have make the project find the appropriate header files and libraries.

What else is left?

genpfault
  • 51,148
  • 11
  • 85
  • 139
Sarim Javaid Khan
  • 810
  • 15
  • 30
  • possible duplicate of [How to use GLEW with MinGW](http://stackoverflow.com/questions/8870793/how-to-use-glew-with-mingw) – Nicol Bolas May 04 '13 at 01:20

2 Answers2

3

This can be caused by attempting to use an MSVC lib under mingw. Either download a library compiled for mingw, or compile your own.

Engineer
  • 8,529
  • 7
  • 65
  • 105
2

Link the library glew32s.lib also. Put this linker at the top of linker list.

Dinesh Subedi
  • 2,603
  • 1
  • 26
  • 36