Link Error with GLFW

nobody wrote on Thursday, July 13, 2006:

First: I’m sorry for my bad english. I’m brazilian and don’t speak very well.

I’m trying to compile a project with glfw in Visual Studio Expreess 2005 and I have some link errors:

"1>main.obj : error LNK2019: unresolved external symbol __imp__glEnd@0 referenced in function "struct Coord __cdecl DrawTile(unsigned int,int,int,int)" (?DrawTile@@YA?AUCoord@@IHHH@Z)
1>main.obj : error LNK2019: unresolved external symbol __imp__glVertex2d@16 referenced in function "struct Coord __cdecl DrawTile(unsigned int,int,int,int)" (?DrawTile@@YA?AUCoord@@IHHH@Z)
1>main.obj : error LNK2019: unresolved external symbol __imp__glTexCoord2f@8 referenced in function "struct Coord __cdecl DrawTile(unsigned int,int,int,int)" (?DrawTile@@YA?AUCoord@@IHHH@Z)
1>main.obj : error LNK2019: unresolved external symbol __imp__glBegin@4 referenced in function "struct Coord __cdecl DrawTile(unsigned int,int,int,int)" (?DrawTile@@YA?AUCoord@@IHHH@Z)
1>main.obj : error LNK2019: unresolved external symbol __imp__glColor3f@12 referenced in function "struct Coord __cdecl DrawTile(unsigned int,int,int,int)" (?DrawTile@@YA?AUCoord@@IHHH@Z)
1>main.obj : error LNK2019: unresolved external symbol __imp__glBindTexture@8 referenced in function "struct Coord __cdecl DrawTile(unsigned int,int,int,int)" (?DrawTile@@YA?AUCoord@@IHHH@Z)
1>main.obj : error LNK2019: unresolved external symbol __imp__glClear@4 referenced in function "struct Coord __cdecl DrawTile(unsigned int,int,int,int)" (?DrawTile@@YA?AUCoord@@IHHH@Z)
1>glfw.lib(win32_window.obj) : error LNK2001: unresolved external symbol __imp__glClear@4
1>main.obj : error LNK2019: unresolved external symbol _gluOrtho2D@32 referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol __imp__glBlendFunc@8 referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol __imp__glPixelStorei@8 referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol __imp__glEnable@4 referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol __imp__glClearColor@16 referenced in function _main
1>glfw.lib(win32_window.obj) : error LNK2001: unresolved external symbol __imp__glClearColor@16
1>main.obj : error LNK2019: unresolved external symbol __imp__glTexEnvi@12 referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol __imp__glMatrixMode@4 referenced in function _main
1>glfw.lib(glext.obj) : error LNK2019: unresolved external symbol __imp__glGetString@4 referenced in function _glfwExtensionSupported
1>glfw.lib(win32_window.obj) : error LNK2001: unresolved external symbol __imp__glGetString@4
1>glfw.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp__wglGetProcAddress@4 referenced in function __glfwInitWGLExtensions
1>glfw.lib(win32_glext.obj) : error LNK2001: unresolved external symbol __imp__wglGetProcAddress@4
1>glfw.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp__wglDeleteContext@4 referenced in function __glfwPlatformCloseWindow
1>glfw.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp__wglMakeCurrent@8 referenced in function __glfwPlatformCloseWindow
1>glfw.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp__glGetFloatv@8 referenced in function __glfwPlatformSetWindowSize
1>glfw.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp__glGetIntegerv@8 referenced in function __glfwPlatformSetWindowSize
1>glfw.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp__wglCreateContext@4 referenced in function __glfwPlatformOpenWindow"

Big list, isn’t!?

Someone can help me?

nobody wrote on Thursday, July 13, 2006:

It looks like you aren’t linking with the OpenGL and GLFW libraries. If that’s the case, add opengl32.lib and glfw.lib to the Input section of the link settings in your project, and make sure Visual Studio knows where to find the GLFW library.

1 Like