Jump to content
  • Advertisement
Sign in to follow this  
taesen00

OpenGL OpenGL in Visual C++ Express

This topic is 4413 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've tried installing OpenGL to run with Microsoft Visual C++ 2005 Express Edition, but I must be missing something. I've installed the following files to these directories: c:\Program Files\Microsoft Visual Studio 8\VC\include\gl\glut.h c:\Program Files\Microsoft Visual Studio 8\VC\include\gl\glui.h c:\Program Files\Microsoft Visual Studio 8\VC\include\gl\glu.h c:\Program Files\Microsoft Visual Studio 8\VC\include\gl\gl.h c:\Program Files\Microsoft Visual Studio 8\VC\include\gl\glaux.h c:\Program Files\Microsoft Visual Studio 8\VC\lib\glut32.lib c:\Program Files\Microsoft Visual Studio 8\VC\lib\glu32.lib c:\Program Files\Microsoft Visual Studio 8\VC\lib\glaux.lib c:\Program Files\Microsoft Visual Studio 8\VC\lib\opengl32.lib c:\WINDOWS\system32\glut32.dll c:\WINDOWS\system32\glu32.dll c:\WINDOWS\system32\Opengl32.dll I've also found the following directions online, but no idea how to do them in Visual C++ 2005 Express: 1. Select "Settings..." from the "Project" menu 2. Select the "Link" tab 3. Scroll to the end of the "Object/library models:" text box and add the following additional libraries: glu32.lib glut32.lib opengl32.lib glaux.lib glui32.lib Mainly because there is not a "Settings" on the "Project" menu. I somehow got into "Project Properties" but found nothing like "Link". Finally, to check my installation, I ran Lesson02 from nehe.gamedev.net, the Visual C++ version. Below is my compiler output: 1>------ Build started: Project: lesson2, Configuration: Debug Win32 ------ 1>Compiling... 1>Lesson2.cpp 1>Linking... 1>Lesson2.obj : error LNK2019: unresolved external symbol __imp__UnregisterClassA@8 referenced in function "void __cdecl KillGLWindow(void)" (?KillGLWindow@@YAXXZ) 1>Lesson2.obj : error LNK2019: unresolved external symbol __imp__DestroyWindow@4 referenced in function "void __cdecl KillGLWindow(void)" (?KillGLWindow@@YAXXZ) 1>Lesson2.obj : error LNK2019: unresolved external symbol __imp__ReleaseDC@8 referenced in function "void __cdecl KillGLWindow(void)" (?KillGLWindow@@YAXXZ) 1>Lesson2.obj : error LNK2019: unresolved external symbol __imp__MessageBoxA@16 referenced in function "void __cdecl KillGLWindow(void)" (?KillGLWindow@@YAXXZ) 1>Lesson2.obj : error LNK2019: unresolved external symbol __imp__ShowCursor@4 referenced in function "void __cdecl KillGLWindow(void)" (?KillGLWindow@@YAXXZ) 1>Lesson2.obj : error LNK2019: unresolved external symbol __imp__ChangeDisplaySettingsA@8 referenced in function "void __cdecl KillGLWindow(void)" (?KillGLWindow@@YAXXZ) 1>Lesson2.obj : error LNK2019: unresolved external symbol __imp__SetFocus@4 referenced in function "int __cdecl CreateGLWindow(char *,int,int,int,bool)" (?CreateGLWindow@@YAHPADHHH_N@Z) 1>Lesson2.obj : error LNK2019: unresolved external symbol __imp__SetForegroundWindow@4 referenced in function "int __cdecl CreateGLWindow(char *,int,int,int,bool)" (?CreateGLWindow@@YAHPADHHH_N@Z) 1>Lesson2.obj : error LNK2019: unresolved external symbol __imp__ShowWindow@8 referenced in function "int __cdecl CreateGLWindow(char *,int,int,int,bool)" (?CreateGLWindow@@YAHPADHHH_N@Z) 1>Lesson2.obj : error LNK2019: unresolved external symbol __imp__SetPixelFormat@12 referenced in function "int __cdecl CreateGLWindow(char *,int,int,int,bool)" (?CreateGLWindow@@YAHPADHHH_N@Z) 1>Lesson2.obj : error LNK2019: unresolved external symbol __imp__ChoosePixelFormat@8 referenced in function "int __cdecl CreateGLWindow(char *,int,int,int,bool)" (?CreateGLWindow@@YAHPADHHH_N@Z) 1>Lesson2.obj : error LNK2019: unresolved external symbol __imp__GetDC@4 referenced in function "int __cdecl CreateGLWindow(char *,int,int,int,bool)" (?CreateGLWindow@@YAHPADHHH_N@Z) 1>Lesson2.obj : error LNK2019: unresolved external symbol __imp__CreateWindowExA@48 referenced in function "int __cdecl CreateGLWindow(char *,int,int,int,bool)" (?CreateGLWindow@@YAHPADHHH_N@Z) 1>Lesson2.obj : error LNK2019: unresolved external symbol __imp__AdjustWindowRectEx@16 referenced in function "int __cdecl CreateGLWindow(char *,int,int,int,bool)" (?CreateGLWindow@@YAHPADHHH_N@Z) 1>Lesson2.obj : error LNK2019: unresolved external symbol __imp__RegisterClassA@4 referenced in function "int __cdecl CreateGLWindow(char *,int,int,int,bool)" (?CreateGLWindow@@YAHPADHHH_N@Z) 1>Lesson2.obj : error LNK2019: unresolved external symbol __imp__LoadCursorA@8 referenced in function "int __cdecl CreateGLWindow(char *,int,int,int,bool)" (?CreateGLWindow@@YAHPADHHH_N@Z) 1>Lesson2.obj : error LNK2019: unresolved external symbol __imp__LoadIconA@8 referenced in function "int __cdecl CreateGLWindow(char *,int,int,int,bool)" (?CreateGLWindow@@YAHPADHHH_N@Z) 1>Lesson2.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) 1>Lesson2.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) 1>Lesson2.obj : error LNK2019: unresolved external symbol __imp__SwapBuffers@4 referenced in function _WinMain@16 1>Lesson2.obj : error LNK2019: unresolved external symbol __imp__DispatchMessageA@4 referenced in function _WinMain@16 1>Lesson2.obj : error LNK2019: unresolved external symbol __imp__TranslateMessage@4 referenced in function _WinMain@16 1>Lesson2.obj : error LNK2019: unresolved external symbol __imp__PeekMessageA@20 referenced in function _WinMain@16 1>.\Debug/lesson2.exe : fatal error LNK1120: 23 unresolved externals 1>Build log was saved at "file://c:\Documents and Settings\aaron.cardona.PA06003\Desktop\lesson02(c)\Lesson02\Debug\BuildLog.htm" 1>lesson2 - 24 error(s), 0 warning(s) ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== I also tried including stdlib.h before all the other includes, but that didn't change anything. Someone please help. I've spent about two weeks searching on Google, MSDN forums, and here, but I've not yet come up with anything.

Share this post


Link to post
Share on other sites
Advertisement
looks like you're missing some windows libraries. I included those:

winmm.lib
kernel32.lib
user32.lib
gdi32.lib
winspool.lib
comdlg32.lib
advapi32.lib
shell32.lib
ole32.lib
oleaut32.lib
uuid.lib

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
You should add the libraries Lord_Evil pointed out in "Project Properties" -> "Linker" -> "Input" , under "Additional libraries"

Share this post


Link to post
Share on other sites
The "standard" windows libraries (kernel32, gdi32, user32, ...) are linked in to all projects automatically in the Standard and Pro versions of Visual C++. You can make this happen in express by editing a config file. I don't remember the name of it now. I think the file extension is ".vsprops". When you find those files, you'll see one called something like vcexpress.vsprops. Open that file and it'll have only kernel32.lib by default. There is another file, if I remember, called vcstandard.vsprops. If you copy the "standard" settings to the "express" file, you don't have to worry about link errors like this anymore.

Edit: Oh. Check the link above. Maybe that's where I found this out in the first place :)

[Edited by - i deal napalm on September 19, 2006 11:47:54 AM]

Share this post


Link to post
Share on other sites
So, three hours later...

Redid the Platform SDK installation, and everything works!

You guys rock! Thanks a ton.

Now, onto some coding...

Share this post


Link to post
Share on other sites
hi,I think you missing the flatform sdk 1,I met the problem before,
and I install the flatform sdk 1,then,It's no any problem...
good luck! :p

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!