1
votes

I wanted to create new OpenGl/GLEW/GLFW Visual Studio project in 64 bit. So I downloaded glew binaries and glfw binaries. My project settings are as followed:

Additional Libraries:

  • glew-2.1.0\lib\Release\x64
  • glfw-3.3.bin.WIN64\lib-vc2019

Additional Dependencies:

  • glew32s.lib (I dont get why its named glew32 and its in x64 folder)
  • opengl32.lib
  • glfw3.lib

With such setting for every glew function like glGenBuffers or glUseProgram or anything I get LNK2001 unresolved external symbol error. Any clue where I did a mistake?

(And since I am a new to all of these can someone explain why do I have to link opengl32.lib on 64 bit app and why there is no opengl64.lib and so on?)

2

2 Answers

1
votes

When you want to link the static glew library on windows, then you've to define the GLEW_STATIC preprocessor definition when you compile your application.
See Building Your Project with GLEW
and GLEW - why should I define GLEW_STATIC?.

If you use gnu (g++), then just add -D GLEW_STATIC to the build command.
In Visual Studio add GLEW_STATIC to the Project properties -> C/C++ -> Preprocessor -> Preprocessor Definitions

0
votes

Well it seems to work when I link it dynamicly (glew32.lib instead of glew32s.lib). Still no clue why static linking didnt work out.