Sign in to follow this  

trying to get opengl started on vc++

This topic is 4107 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

i have read the faq on this site and now i DO have the files gl.h glut.h glu.h in the vc++ include dir, Opengl32.lib glut32.lib glu32.lib in lib, and Opengl32.dll glut32.dll glu32.dll in windows/system but I still get linker errors.. this is really frustrating. I am using visual c++ 2005 express edition and trying to build nehe's first lesson (I have downloaded the visual studio version from nehe.gamedev.net ) and I am getting the following error message: Linking... Lesson1.obj : error LNK2019: unresolved external symbol __imp__UnregisterClassA@8 referenced in function "void __cdecl KillGLWindow(void)" (?KillGLWindow@@YAXXZ) Lesson1.obj : error LNK2019: unresolved external symbol __imp__DestroyWindow@4 referenced in function "void __cdecl KillGLWindow(void)" (?KillGLWindow@@YAXXZ) Lesson1.obj : error LNK2019: unresolved external symbol __imp__ReleaseDC@8 referenced in function "void __cdecl KillGLWindow(void)" (?KillGLWindow@@YAXXZ) Lesson1.obj : error LNK2019: unresolved external symbol __imp__MessageBoxA@16 referenced in function "void __cdecl KillGLWindow(void)" (?KillGLWindow@@YAXXZ) Lesson1.obj : error LNK2019: unresolved external symbol __imp__ShowCursor@4 referenced in function "void __cdecl KillGLWindow(void)" (?KillGLWindow@@YAXXZ) Lesson1.obj : error LNK2019: unresolved external symbol __imp__ChangeDisplaySettingsA@8 referenced in function "void __cdecl KillGLWindow(void)" (?KillGLWindow@@YAXXZ) Lesson1.obj : error LNK2019: unresolved external symbol __imp__SetFocus@4 referenced in function "int __cdecl CreateGLWindow(char *,int,int,int,bool)" (?CreateGLWindow@@YAHPADHHH_N@Z) Lesson1.obj : error LNK2019: unresolved external symbol __imp__SetForegroundWindow@4 referenced in function "int __cdecl CreateGLWindow(char *,int,int,int,bool)" (?CreateGLWindow@@YAHPADHHH_N@Z) Lesson1.obj : error LNK2019: unresolved external symbol __imp__ShowWindow@8 referenced in function "int __cdecl CreateGLWindow(char *,int,int,int,bool)" (?CreateGLWindow@@YAHPADHHH_N@Z) Lesson1.obj : error LNK2019: unresolved external symbol __imp__SetPixelFormat@12 referenced in function "int __cdecl CreateGLWindow(char *,int,int,int,bool)" (?CreateGLWindow@@YAHPADHHH_N@Z) Lesson1.obj : error LNK2019: unresolved external symbol __imp__ChoosePixelFormat@8 referenced in function "int __cdecl CreateGLWindow(char *,int,int,int,bool)" (?CreateGLWindow@@YAHPADHHH_N@Z) Lesson1.obj : error LNK2019: unresolved external symbol __imp__GetDC@4 referenced in function "int __cdecl CreateGLWindow(char *,int,int,int,bool)" (?CreateGLWindow@@YAHPADHHH_N@Z) Lesson1.obj : error LNK2019: unresolved external symbol __imp__CreateWindowExA@48 referenced in function "int __cdecl CreateGLWindow(char *,int,int,int,bool)" (?CreateGLWindow@@YAHPADHHH_N@Z) Lesson1.obj : error LNK2019: unresolved external symbol __imp__AdjustWindowRectEx@16 referenced in function "int __cdecl CreateGLWindow(char *,int,int,int,bool)" (?CreateGLWindow@@YAHPADHHH_N@Z) Lesson1.obj : error LNK2019: unresolved external symbol __imp__RegisterClassA@4 referenced in function "int __cdecl CreateGLWindow(char *,int,int,int,bool)" (?CreateGLWindow@@YAHPADHHH_N@Z) Lesson1.obj : error LNK2019: unresolved external symbol __imp__LoadCursorA@8 referenced in function "int __cdecl CreateGLWindow(char *,int,int,int,bool)" (?CreateGLWindow@@YAHPADHHH_N@Z) Lesson1.obj : error LNK2019: unresolved external symbol __imp__LoadIconA@8 referenced in function "int __cdecl CreateGLWindow(char *,int,int,int,bool)" (?CreateGLWindow@@YAHPADHHH_N@Z) Lesson1.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) Lesson1.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) Lesson1.obj : error LNK2019: unresolved external symbol __imp__SwapBuffers@4 referenced in function _WinMain@16 Lesson1.obj : error LNK2019: unresolved external symbol __imp__DispatchMessageA@4 referenced in function _WinMain@16 Lesson1.obj : error LNK2019: unresolved external symbol __imp__TranslateMessage@4 referenced in function _WinMain@16 Lesson1.obj : error LNK2019: unresolved external symbol __imp__PeekMessageA@20 referenced in function _WinMain@16 .\Debug/lesson1.exe : fatal error LNK1120: 23 unresolved externals (note that nehe says something about a project->settings and then click on the LINK tab to add some gl modules, but there is no such thing in the menu, probably the tutorial is written for an older version of vc)

Share this post


Link to post
Share on other sites
I'm assuming there are other files missing from the lib; make sure all the standard libs are there and you didnt delete them.

Also, if you're just starting, I'd avoid learning OpenGL now.

Share this post


Link to post
Share on other sites
OH, he is referring to the VC 6.0

One sec, let me open my IDE.. Ok, I dont have the one you're using, but look for a directories, a Library, an options, a build set up, look for anything to add the .libs to the appropriate line.

Share this post


Link to post
Share on other sites
why should I avoid opengl now? I am aware of the differences btw directx and gl, I have spent a few time reading to find out what I want to learn. I have chosen gl because it is portable and .. because some people say it is easyer to learn..

Share this post


Link to post
Share on other sites
From the looks of it, he is just starting C++.. I'd learn more of the basics first. Granted, NeHe does an incredible job, I'd imagine it a lot more difficult putting it all to use without a foundation of programming.

Share this post


Link to post
Share on other sites
Also remember that you need to download the platform sdk for Windows if you downloaded MSVC 2005 Express. Windows® Server 2003 R2 Platform SDK. If you have already installed a PSDK then you need to update your IDE and tell it where those libraries / header files are located as described in the above posts. Just to reiterate...in MSVC 2005 you would go to Tools->Options->Projects and Solutions->VC++ Directories. The important ones are Libray Files / Include Files / Executable Files/ Source Files (see the combo box at the upper right of the dialog ). Library files will be found in "lib" directories / include files will be in "include" dirs / exectuables will be in "bin" dirs ...source will be in "src" directories.

[edit]
Updated link to newest PSDK

Share this post


Link to post
Share on other sites
Hope this helps:

Right click on your solution and click on properties like so:
Image Hosted by ImageShack.us

The window seen below will pop up, click on Linker, and then click on Input. You'll see Additional Dependencies at the top, simply enter the libs that you require next to it.
Image Hosted by ImageShack.us

Share this post


Link to post
Share on other sites
Did you not create a Windows Application from the solution creation wizard? That's what gave me those errors the first time I tried to use nehe's lessons. I'll assume that you didn't, and assume that the reason was because the button was grayed out. Click on this link and make sure you've completed all the steps, and the button will suddenly become usable.

Share this post


Link to post
Share on other sites
hey, thanks for all the replies, but meanwhile I found VC++6 and installed it. It works just fine. I'm now playing with what I have learned from nehe's tutorials. I don't know why that newer version wasn't working, it was missing a lot of things..
edit: maybe because it was free from microsoft :P

Share this post


Link to post
Share on other sites

This topic is 4107 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