Advertisement

linker errors

Started by April 29, 2005 08:34 AM
1 comment, last by eSCHEn 19 years, 9 months ago
hey everyone, i'm trying to create a window with opengl stuff, from the lesson 1 code for a simple one.. i'm getting lots of linker errors tho, and i'm not sure how to fix them. Possibly i'm not including or linking these correctly.. #include <gl\gl.h> #include <gl\glu.h> #include <gl\glaux.h> the kind of errors that i'm gettin are these.. First Windows error LNK2019: unresolved external symbol __imp__glClear@4 referenced in function "int __cdecl DrawGLScene(void)" (?DrawGLScene@@YAHXZ) can anyone help me to sort these out?? Thanks
Any time you get an "unresolved external symbol" error for a symbol that you didn't define yourself, it almost always means you forgot to link to a library. I have seen this sort of error with DirectX many times, and the solution is to make sure you are linking to d3d8.lib, dxguid.lib, etc. So just link to the appropriate OpenGL library(s) and you should be fine. (Generally this is done through the linker input section of the project settings, but it varies by IDE.)
Advertisement
Mumpo is spot on, the libraries you need to include are opengl32, glu32 and glaux. Be aware that glaux is unsupported and you may not have the library and header files for it, Google should turn up the right bits though.
--
Cheers,
Darren Clark

This topic is closed to new replies.

Advertisement