Problem with NeHe OpenGl tutorial

Started by
7 comments, last by am0K 17 years, 11 months ago
hi, I decided to start with OpenGL and found NeHe´s OpenGL tutorial. I did lesson 01 "Setting up an GL winodw". I wrote the hole thing and compiled it. A small part of the error massage I got is : OpenGL.obj : error LNK2019: unresolved external symbol __imp__UnregisterClassA@8 referenced in function "void __cdecl KillGLWindow(void)" (?KillGLWindow@@YAXXZ) The others are the quite the same. Don´t no what to do, maybe one of you got an answer. thx amoK
Advertisement
Did you link with the correct libraries, i.e. user32.lib, kernel32.lib etc.?
think so
this is my LIB Path :
LIB=F:\Program Files\Microsoft Visual Studio 8\Vc\LIB; F:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\lib;F:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Lib;


amoK

edit
yes, both kernel32 and user32 are there.
Hmm.. could you share some code then?
Here is the link to the lesson were i have this from:
http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=01

This is a piece of the code:

GLvoid KillGLWindow(GLvoid) // Properly Kill The Window
{
if (fullscreen) // Are We In Fullscreen Mode?
{
ChangeDisplaySettings(NULL,0); // If So Switch Back To The Desktop
ShowCursor(TRUE); // Show Mouse Pointer
}
if (hRC) // Do We Have A Rendering Context?
{
if (!wglMakeCurrent(NULL,NULL)) // Are We Able To Release The DC And RC Contexts?
{
MessageBox(NULL,"Release Of DC And RC Failed.","SHUTDOWN ERROR",MB_OK | MB_ICONINFORMATION);

}
if (!wglDeleteContext(hRC)) // Are We Able To Delete The RC?
{
MessageBox(NULL,"Release Rendering Context Failed.","SHUTDOWN ERROR",MB_OK | MB_ICONINFORMATION);
}
hRC=NULL; // Set RC To NULL
}
if (hDC && !ReleaseDC(hWnd,hDC)) // Are We Able To Release The DC
{
MessageBox(NULL,"Release Device Context Failed.","SHUTDOWN ERROR",MB_OK | MB_ICONINFORMATION);
hDC=NULL; // Set DC To NULL
}
if (hWnd && !DestroyWindow(hWnd)) // Are We Able To Destroy The Window?
{
MessageBox(NULL,"Could Not Release hWnd.","SHUTDOWN ERROR",MB_OK | MB_ICONINFORMATION);
hWnd=NULL; // Set hWnd To NULL
}
if (!UnregisterClass("OpenGL",hInstance)) // Are We Able To Unregister Class
{
MessageBox(NULL,"Could Not Unregister Class.","SHUTDOWN ERROR",MB_OK | MB_ICONINFORMATION);
hInstance=NULL; // Set hInstance To NULL
}
}

amoK
What IDE are you using?

Not all the files in the lib path are linked automatically.
The IDE just tells the compiler to look there.

Did you create a project? Or did you just type in the code in a sourcefile?

Try downloading the code for your IDE, open the project file there and look what project settings are different there.
Writing errors since 10/25/2003 2:25:56 AM
Quote:Original post by am0K
think so
this is my LIB Path :
LIB=F:\Program Files\Microsoft Visual Studio 8\Vc\LIB; F:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\lib;F:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Lib;


amoK

edit
yes, both kernel32 and user32 are there.


pulpfist -> So I think he is using visual studio 2005
------------Something useful could be written here...
yes I worj with Visual 2005 Express Edition.
But I use another text editor, and compile in another shell, so I just typed the source code.
I will try to copy my code in a project.

amoK

This topic is closed to new replies.

Advertisement