Sign in to follow this  
am0K

Problem with NeHe OpenGl tutorial

Recommended Posts

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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this