[try Beta version]
Not logged in

 
Some linker errors I don't understand

Jul 14, 2010 at 3:23pm
I have recieved some linker errors in my program:

1>Main.obj : error LNK2019: unresolved external symbol _gluPerspective@32 referenced in function "void __cdecl ReSizeGLScene(int,int)" (?ReSizeGLScene@@YAXHH@Z)
1>Main.obj : error LNK2019: unresolved external symbol __imp__glLoadIdentity@0 referenced in function "void __cdecl ReSizeGLScene(int,int)" (?ReSizeGLScene@@YAXHH@Z)
1>Main.obj : error LNK2019: unresolved external symbol __imp__glMatrixMode@4 referenced in function "void __cdecl ReSizeGLScene(int,int)" (?ReSizeGLScene@@YAXHH@Z)
1>Main.obj : error LNK2019: unresolved external symbol __imp__glViewport@16 referenced in function "void __cdecl ReSizeGLScene(int,int)" (?ReSizeGLScene@@YAXHH@Z)
1>Main.obj : error LNK2019: unresolved external symbol __imp__glHint@8 referenced in function "int __cdecl InitGL(void)" (?InitGL@@YAHXZ)
1>Main.obj : error LNK2019: unresolved external symbol __imp__glDepthFunc@4 referenced in function "int __cdecl InitGL(void)" (?InitGL@@YAHXZ)
1>Main.obj : error LNK2019: unresolved external symbol __imp__glEnable@4 referenced in function "int __cdecl InitGL(void)" (?InitGL@@YAHXZ)
1>Main.obj : error LNK2019: unresolved external symbol __imp__glClearDepth@8 referenced in function "int __cdecl InitGL(void)" (?InitGL@@YAHXZ)
1>Main.obj : error LNK2019: unresolved external symbol __imp__glClearColor@16 referenced in function "int __cdecl InitGL(void)" (?InitGL@@YAHXZ)
1>Main.obj : error LNK2019: unresolved external symbol __imp__glShadeModel@4 referenced in function "int __cdecl InitGL(void)" (?InitGL@@YAHXZ)
1>Main.obj : error LNK2019: unresolved external symbol __imp__glClear@4 referenced in function "int __cdecl DrawGLScene(void)" (?DrawGLScene@@YAHXZ)
1>Main.obj : error LNK2019: unresolved external symbol __imp__wglDeleteContext@4 referenced in function "void __cdecl KillGLWindow(void)" (?KillGLWindow@@YAXXZ)
1>Main.obj : error LNK2019: unresolved external symbol __imp__wglMakeCurrent@8 referenced in function "void __cdecl KillGLWindow(void)" (?KillGLWindow@@YAXXZ)
1>Main.obj : error LNK2019: unresolved external symbol __imp__wglCreateContext@4 referenced in function "int __cdecl CreateGLWindow(char *,int,int,int,bool)" (?CreateGLWindow@@YAHPADHHH_N@Z)

I really do not understand these, could someone help please?
Jul 14, 2010 at 3:30pm
It means you're not linking to some OpenGL or GLU import library.
Jul 14, 2010 at 3:36pm
Thanks, so I've got these librarys:

#include <windows.h> // Header File For Windows
#include "gl\gl.h" // Header File For The OpenGL32 Library
#include "gl\glu.h" // Header File For The GLu32 Library

So what do I need to do?
Jul 14, 2010 at 3:51pm
closed account (DSvMDjzh)
should be
1
2
#include "gl/gl.h"
#include "gl/glu.h" 


you need to change the slash
Jul 14, 2010 at 3:57pm
Thanks, but that doesn't make any difference.
Jul 14, 2010 at 4:04pm
closed account (DSvMDjzh)
Do you actually have the librarys? if you don't you can download them somewhere.
Jul 14, 2010 at 4:05pm
You need to link your project to OpenGL32.lib and glu.lib (not sure about the second one)
How to do that depends on your ide.
Jul 14, 2010 at 8:19pm
1
2
#include <gl/gl.h>
#include <gl/glu.h>  


Unless you have the files locally in your project directory, you need the "<" and ">".

Also, what hamster said.
Jul 14, 2010 at 8:23pm
Quotes work, as well.
Topic archived. No new replies allowed.