DazKins
DazKins

Reputation: 115

GLEW libraries seems to have issues when linking

I'm getting really frustrated now with trying to link this glew Library

Here's the build log:

g++ -o test.exe "src\\test.o" -lglew32 -lglfw -lglu32 -lopengl32 
src\test.o: In function `main':
C:\dev\test\Debug/../src/test.cpp:31: undefined reference to `_imp__glewInit@0'
C:\dev\test\Debug/../src/test.cpp:41: undefined reference to `_imp____glewGenVertexArrays'
C:\dev\test\Debug/../src/test.cpp:42: undefined reference to `_imp____glewBindVertexArray'

I've tried moving around which libraries go first in the build command.

This seems to be an issue that others on the internet are having but i cant seem to find any of them that have fixed it

Upvotes: 0

Views: 1345

Answers (1)

DazKins
DazKins

Reputation: 115

Ok I know it's a bit wierd be answering my own question but here was the issue:

Apparently the errors were occuring in two areas

  • For a starter, i didn't need glu32 only opengl32 as i beleive glew handled this itself
  • Secondly, for some wierd reason i had to call

    #define GLEW_STATIC
    

    manually before I imported

Upvotes: 1

Related Questions