0

So this isn't the first time I have run into this problem, but the solutions that worked in the past don't seem to be working. I am currently receiving the following errors:

Error   LNK1120 6 unresolved externals
Error   LNK2019 unresolved external symbol __imp__glGetString@4 referenced in function _glewContextInit@0
Error   LNK2019 unresolved external symbol __imp__wglGetCurrentDC@0 referenced in function _wglewGetExtension@4
Error   LNK2019 unresolved external symbol __imp__wglGetProcAddress@4 referenced in function __glewInit_GL_3DFX_tbuffer
Error   LNK2019 unresolved external symbol __imp__glClear@4 referenced in function "public: void __thiscall vortex::graphics::Window::clear(void)const " (?clear@Window@graphics@vortex@@QBEXXZ)
Error   LNK2019 unresolved external symbol __imp__glEnable@4 referenced in function "private: bool __thiscall vortex::graphics::Window::init(void)" (?init@Window@graphics@vortex@@AAE_NXZ)
Error   LNK2019 unresolved external symbol __imp__glViewport@16 referenced in function "void __cdecl vortex::graphics::windowResize(struct GLFWwindow *,int,int)" (?windowResize@graphics@vortex@@YAXPAUGLFWwindow@@HH@Z)

to give you a rundown of what I have tried, I have checked and rechecked the linking paths to the libraries, I have put the GLEW_STATIC preprocessor definition in the necessary section, I have redownloaded the libraries multiple times to make sure I was linking a Win32 library to the Win32 application, and I have no idea what to do now. It was working fine for awhile, and the above solutions would always fix this sort of error, but not this time. The sooner I can get a response the better, as this is a project that I wanna get more work done on soon. Thank you for any help you can give me.

Devurauxe
  • 41
  • 7

3 Answers3

2

Add OpenGL32.lib and glu32.lib to your linker inputs.

Johan Boulé
  • 1,936
  • 15
  • 19
1

Add opengl32.lib to your linker inputs, and add GLEW_STATIC to your Properties->C/C++->Preprocessor->Preprocessor Definitions

Zixuan SHI
  • 11
  • 1
-1

I had a very similar problem myself, and the solution for me was adding the glew32.dll to the folder, as well as adding #pragma comment(lib, "glew32.lib") and linking to it. The glew32.dll will refer to glew32.lib, so if you dont have it, it will give off similar linking errors.

Charlie
  • 585
  • 9
  • 17