NOTE: Yes, I have specified GLEW_STATIC.
So I have been through this rodeo before trying to setup glew for use in a new project, but now that I am using glew 2.0 in a project, it is producing linking errors. I've just generated the source in a linux instance and using them like this.
#include "Renderer.h"
#include <windows.h>
#include "GL/glew.h"
#include "Logger.h"
void Renderer::init(void* windowHandle) {
Logger logger("Renderer::init");
GLenum result = glewInit();
if (result != GLEW_OK) {
LOG(logger) << "Failed to run glew init with error: " << result;
}
}
This is a function that I have declared in a namespace renderer and define here. The relevance is that I only call glewInit()
, that is it.
The linking errors produced are:
Error LNK2019 unresolved external symbol __imp_glGetIntegerv referenced in function glewContextInit
Error LNK2019 unresolved external symbol __imp_glGetString referenced in function glewContextInit
Error LNK2019 unresolved external symbol __imp_wglGetCurrentDC referenced in function wglewInit
Error LNK2019 unresolved external symbol __imp_wglGetProcAddress referenced in function wglewInit
The difference here between the normal, "no declared functions are defined" type of errors, these selected four are the only ones missing. Since they have the __imp_ tag attached usually indicating that they are expecting a dynamic library to link in, so something tells me their might be an error in the generated file? Anybody encountered this issue with linking glew?