Sign in to follow this  

NeHe Tutorial One Problems

This topic is 4587 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

So I did the first tutorial. I copy and pasted everything from the HTML page. I added the three libraries ("OpenGL32.lib", "GLu32.lib", and "GLaux.lib") and made sure it had the right directory linked. What I got was 23 unresolved external symbols. I need some help putting this together. Thanks for any help. Matthew EXTRA : The Errors wintest.obj : error LNK2019: unresolved external symbol __imp__UnregisterClassA@8 referenced in function "void __cdecl KillGLWindow(void)" (?KillGLWindow@@YAXXZ) wintest.obj : error LNK2019: unresolved external symbol __imp__DestroyWindow@4 referenced in function "void __cdecl KillGLWindow(void)" (?KillGLWindow@@YAXXZ) wintest.obj : error LNK2019: unresolved external symbol __imp__ReleaseDC@8 referenced in function "void __cdecl KillGLWindow(void)" (?KillGLWindow@@YAXXZ) wintest.obj : error LNK2019: unresolved external symbol __imp__MessageBoxA@16 referenced in function "void __cdecl KillGLWindow(void)" (?KillGLWindow@@YAXXZ) wintest.obj : error LNK2019: unresolved external symbol __imp__ShowCursor@4 referenced in function "void __cdecl KillGLWindow(void)" (?KillGLWindow@@YAXXZ) wintest.obj : error LNK2019: unresolved external symbol __imp__ChangeDisplaySettingsA@8 referenced in function "void __cdecl KillGLWindow(void)" (?KillGLWindow@@YAXXZ) wintest.obj : error LNK2019: unresolved external symbol __imp__SetFocus@4 referenced in function "int __cdecl CreateGLWindow(char *,int,int,int,bool)" (?CreateGLWindow@@YAHPADHHH_N@Z) wintest.obj : error LNK2019: unresolved external symbol __imp__SetForegroundWindow@4 referenced in function "int __cdecl CreateGLWindow(char *,int,int,int,bool)" (?CreateGLWindow@@YAHPADHHH_N@Z) wintest.obj : error LNK2019: unresolved external symbol __imp__ShowWindow@8 referenced in function "int __cdecl CreateGLWindow(char *,int,int,int,bool)" (?CreateGLWindow@@YAHPADHHH_N@Z) wintest.obj : error LNK2019: unresolved external symbol __imp__SetPixelFormat@12 referenced in function "int __cdecl CreateGLWindow(char *,int,int,int,bool)" (?CreateGLWindow@@YAHPADHHH_N@Z) wintest.obj : error LNK2019: unresolved external symbol __imp__ChoosePixelFormat@8 referenced in function "int __cdecl CreateGLWindow(char *,int,int,int,bool)" (?CreateGLWindow@@YAHPADHHH_N@Z) wintest.obj : error LNK2019: unresolved external symbol __imp__GetDC@4 referenced in function "int __cdecl CreateGLWindow(char *,int,int,int,bool)" (?CreateGLWindow@@YAHPADHHH_N@Z) wintest.obj : error LNK2019: unresolved external symbol __imp__CreateWindowExA@48 referenced in function "int __cdecl CreateGLWindow(char *,int,int,int,bool)" (?CreateGLWindow@@YAHPADHHH_N@Z) wintest.obj : error LNK2019: unresolved external symbol __imp__AdjustWindowRectEx@16 referenced in function "int __cdecl CreateGLWindow(char *,int,int,int,bool)" (?CreateGLWindow@@YAHPADHHH_N@Z) wintest.obj : error LNK2019: unresolved external symbol __imp__RegisterClassA@4 referenced in function "int __cdecl CreateGLWindow(char *,int,int,int,bool)" (?CreateGLWindow@@YAHPADHHH_N@Z) wintest.obj : error LNK2019: unresolved external symbol __imp__LoadCursorA@8 referenced in function "int __cdecl CreateGLWindow(char *,int,int,int,bool)" (?CreateGLWindow@@YAHPADHHH_N@Z) wintest.obj : error LNK2019: unresolved external symbol __imp__LoadIconA@8 referenced in function "int __cdecl CreateGLWindow(char *,int,int,int,bool)" (?CreateGLWindow@@YAHPADHHH_N@Z) wintest.obj : error LNK2019: unresolved external symbol __imp__DefWindowProcA@16 referenced in function "long __stdcall WndProc(struct HWND__ *,unsigned int,unsigned int,long)" (?WndProc@@YGJPAUHWND__@@IIJ@Z) wintest.obj : error LNK2019: unresolved external symbol __imp__PostQuitMessage@4 referenced in function "long __stdcall WndProc(struct HWND__ *,unsigned int,unsigned int,long)" (?WndProc@@YGJPAUHWND__@@IIJ@Z) wintest.obj : error LNK2019: unresolved external symbol __imp__SwapBuffers@4 referenced in function _WinMain@16 wintest.obj : error LNK2019: unresolved external symbol __imp__DispatchMessageA@4 referenced in function _WinMain@16 wintest.obj : error LNK2019: unresolved external symbol __imp__TranslateMessage@4 referenced in function _WinMain@16 wintest.obj : error LNK2019: unresolved external symbol __imp__PeekMessageA@20 referenced in function _WinMain@16 Debug/wintest.exe : fatal error LNK1120: 23 unresolved externals

Share this post


Link to post
Share on other sites
What compiler are you using? The main code in NeHe's tutorials is built for Visual C++, at the bottom of each page you'll see a link for converted code specifically for your compiler/IDE.

Share this post


Link to post
Share on other sites
You started a new Win32 project, added some files and pasted in the source code?
Have you tried the VC++ source that comes with the tutorial?

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
I copy and pasted the code from the HTML tutorial. I have also downloaded it and added it into the project. When I build it, same erros. 23 unresolved external symbols and one error telling me that I have 23 unresolved external symbols.

The folder that I downloaded came with three code files. A .ccp, a .dsp, and a .dsw. Do I need to add those or are those for something else?

Share this post


Link to post
Share on other sites
it looks like there are a couple of windows liberies that you havn't linked to the project.
These are the ones i have linked in my code, check if you are missing one of them, if you do then try adding it and see what happens.
OpenGL32.lib GLu32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib

Share this post


Link to post
Share on other sites
Spectacular. I'm not sure how I was suppose to figure that out... the tut didn't mention it. Anyway, it works now. Thanks a lot, though I'm sure I'll have more problems in the future... lol. Cheers.

Matthew

Share this post


Link to post
Share on other sites
its not the authors fault...when create programs for windows u most like use the win32 api to get ur self start and then add other api's on the only difference is the winmain and the messages that must be taken care of. sdl hides the nasty win32 api. since you are using a visual studio compiler.. picking win32 apps instead of win32 console app supposely eliminates the process of know which libraries to add to the linker's list.

Share this post


Link to post
Share on other sites

This topic is 4587 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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