Jump to content

  • Log In with Google      Sign In   
  • Create Account


Weird GLEW linker error (VS 2012)


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 SomeGuyOnHisComputer   Members   -  Reputation: 190

Like
0Likes
Like

Posted 13 June 2013 - 07:38 PM

Hi, I'm new to both C++ and OpenGL. I only know the basics of the former, and practically nothing about the latter.

So I've been trying to follow this series of tutorials: http://www.opengl-tutorial.org/beginners-tutorials/tutorial-1-opening-a-window/

 

I can get GLFW to open a window just fine (ignoring GLEW by commenting out some code).

 

Around glewExperimental=true; is where I start to get issues. (based on what I've read, I believe it should technically be glewExperimental=GL_TRUE, but I get the same errors regardless). I get linker error "LNK2001 unresolved external symbol" thrown at me every time I try to build the project with the glewExperimental variable referenced. If I were to take that out and continue onward to the next tutorial, I get the same error for things like ___glewBindVertexArray and ___glewGenVertexArrays.

 

Glew seems to initialize fine though, and through trial and error it seems like the IDE can see the .lib and header just fine after I put them in the same place as GLFW's respective lib and headers.

 

I have GLEW_BUILD defined, the DLL is in a place where it can be seen. As far as I know I'm using the correct lib for the DLL version (glew32.lib), I have these additional dependencies defined: glu32.lib opengl32.lib glfwdll.lib glew32.lib - in that order. I've tried adding some other ones such as gdi32.lib to see if that would make a difference, it didn't.

 

I've tried the debug version of GLEW, I've tried building it myself. I've spent hours googleing a solution with no avail. No one else is having the same issue so I figure I must be doing something wrong, but I have no idea what.

 



Sponsor:

#2 BitMaster   Crossbones+   -  Reputation: 3894

Like
1Likes
Like

Posted 14 June 2013 - 12:59 AM

I don't have GLEW in front of me right now to check, but defining GLEW_BUILD sounds fishy. Typically, that sounds like a symbol that should only be defined while building the GLEW library itself, not anything depending on it.

You might have to define (or not define) GLEW_STATIC though depening on how you plan to link GLEW.



#3 SomeGuyOnHisComputer   Members   -  Reputation: 190

Like
0Likes
Like

Posted 14 June 2013 - 01:43 AM

Commenting out the GLEW_BUILD definition solved everything. Thanks man! smile.png

 

I'm pretty sure I misread the GLEW documentation while making the assumption that dynamic libraries needed definitions because GLFW needed a definition. I guess it's time for me to learn about libraries.


Edited by SomeGuyOnHisComputer, 14 June 2013 - 01:45 AM.





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS