c++glewunresolved-external

Unresolved external symbols linking to glew32s.lib


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.


Solution

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