Malone
06-20-2002, 09:47 PM
I'm pretty new at C++ for starters, and VERY new at Windows programming, but I got a book from the library about programming OpenGL apps in Windows. The book starts off with a very simple example: a Windows application that opens a window with an OpenGL rendering context, that has a simple red triangle rotating in the middle of the window. The code seems fairly straightforward, and I think I understand most of it.
Here's the catch though. I type in the code EXACTLY as I see it in this book into my trusty VC++ 6.0 editor in a new empty project. It is a single .cpp file. I then compile the code. It compiles fine, zero errors, zero warnings. But when I go to run the executable, it asks me if I want to build it (i choose yes of course), then it gives me the following error messages...
--------------------Configuration: MyFirstOpenGLApp - Win32 Debug--------------------
Linking...
BasicWindowsOpenGLApp.obj : error LNK2001: unresolved external symbol _gluPerspective@32
BasicWindowsOpenGLApp.obj : error LNK2001: unresolved external symbol __imp__glLoadIdentity@0
BasicWindowsOpenGLApp.obj : error LNK2001: unresolved external symbol __imp__glMatrixMode@4
BasicWindowsOpenGLApp.obj : error LNK2001: unresolved external symbol __imp__glViewport@16
BasicWindowsOpenGLApp.obj : error LNK2001: unresolved external symbol __imp__wglDeleteContext@4
BasicWindowsOpenGLApp.obj : error LNK2001: unresolved external symbol __imp__wglMakeCurrent@8
BasicWindowsOpenGLApp.obj : error LNK2001: unresolved external symbol __imp__wglCreateContext@4
BasicWindowsOpenGLApp.obj : error LNK2001: unresolved external symbol __imp__glEnd@0
BasicWindowsOpenGLApp.obj : error LNK2001: unresolved external symbol __imp__glVertex3f@12
BasicWindowsOpenGLApp.obj : error LNK2001: unresolved external symbol __imp__glBegin@4
BasicWindowsOpenGLApp.obj : error LNK2001: unresolved external symbol __imp__glColor3f@12
BasicWindowsOpenGLApp.obj : error LNK2001: unresolved external symbol __imp__glRotatef@16
BasicWindowsOpenGLApp.obj : error LNK2001: unresolved external symbol __imp__glTranslatef@12
BasicWindowsOpenGLApp.obj : error LNK2001: unresolved external symbol __imp__glClear@4
Debug/MyFirstOpenGLApp.exe : fatal error LNK1120: 14 unresolved externals
I really have no idea what these mean, and the book isn't any help on debugging issues. I realize it would help if I posted the entire program, but it's pretty lengthy. I'm just wondering if anybody here can tell me in general terms what these errors are?
Here's the catch though. I type in the code EXACTLY as I see it in this book into my trusty VC++ 6.0 editor in a new empty project. It is a single .cpp file. I then compile the code. It compiles fine, zero errors, zero warnings. But when I go to run the executable, it asks me if I want to build it (i choose yes of course), then it gives me the following error messages...
--------------------Configuration: MyFirstOpenGLApp - Win32 Debug--------------------
Linking...
BasicWindowsOpenGLApp.obj : error LNK2001: unresolved external symbol _gluPerspective@32
BasicWindowsOpenGLApp.obj : error LNK2001: unresolved external symbol __imp__glLoadIdentity@0
BasicWindowsOpenGLApp.obj : error LNK2001: unresolved external symbol __imp__glMatrixMode@4
BasicWindowsOpenGLApp.obj : error LNK2001: unresolved external symbol __imp__glViewport@16
BasicWindowsOpenGLApp.obj : error LNK2001: unresolved external symbol __imp__wglDeleteContext@4
BasicWindowsOpenGLApp.obj : error LNK2001: unresolved external symbol __imp__wglMakeCurrent@8
BasicWindowsOpenGLApp.obj : error LNK2001: unresolved external symbol __imp__wglCreateContext@4
BasicWindowsOpenGLApp.obj : error LNK2001: unresolved external symbol __imp__glEnd@0
BasicWindowsOpenGLApp.obj : error LNK2001: unresolved external symbol __imp__glVertex3f@12
BasicWindowsOpenGLApp.obj : error LNK2001: unresolved external symbol __imp__glBegin@4
BasicWindowsOpenGLApp.obj : error LNK2001: unresolved external symbol __imp__glColor3f@12
BasicWindowsOpenGLApp.obj : error LNK2001: unresolved external symbol __imp__glRotatef@16
BasicWindowsOpenGLApp.obj : error LNK2001: unresolved external symbol __imp__glTranslatef@12
BasicWindowsOpenGLApp.obj : error LNK2001: unresolved external symbol __imp__glClear@4
Debug/MyFirstOpenGLApp.exe : fatal error LNK1120: 14 unresolved externals
I really have no idea what these mean, and the book isn't any help on debugging issues. I realize it would help if I posted the entire program, but it's pretty lengthy. I'm just wondering if anybody here can tell me in general terms what these errors are?