[Solved] Visual C++ Express/OpenGL... what am I missing.

Started by
28 comments, last by CombatHammie 17 years, 4 months ago
OK, so I installed the PSDK. Added the directories... all as instructed. And yet I still get errors when trying to compile anything that has <gl.h> or <gl\...> in it. What did I miss? EDIT: Here are all the screens I can think of: [Edited by - CombatHammie on December 16, 2006 9:46:22 PM]
Advertisement
post the errors. You're probably just not linking to the correct libraries.

-me
Try adding
#pragma comment(lib, "opengl32.lib")

to the top of your main file.
1>------ Build started: Project: Simple, Configuration: Debug Win32 ------1>Compiling...1>Simple.cpp1>c:\...\simple\simple.cpp(1) : fatal error C1083: Cannot open include file: 'gl\glut.h': No such file or directory1>Build log was saved at "...\Debug\BuildLog.htm"1>Simple - 1 error(s), 0 warning(s)========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


#pragma comment(lib, "opengl32.lib") yields the same result.
search you hard drive for gl.h Is it there?

If it is there, you need to go into your project settings and enter the path to that file under "additional include directories" in the properties section of the compiler settings.

right click on the project in the solution explorer -> properties -> C/C++ -> General -> Additional Include Directories.

Installing the SDK should have set the classpath environment variable up correctly but whatevs. just make sure the gl.h header actually exists on your machine. =)

-me
GLUT has nothing to do with standart GL or GLU headers.
GLUT is completly independent library.
So it must be installed independently from PSDK.
Hint: get FreeGLUT - http://freeglut.sourceforge.net/
The Microsoft PSDK doesn't come with glut, you need to download it online. After you download it just copy the appropriate files into the appropriate folders within your PSDK (for example put the glut.h file with the PSDK "gl" folder) so you don't have to be bothered to add additional include folders in your project settings.
Thanks bubu, I completely forgot that GLUT is seperate.

Nevertheless, it's just a side thing. GL.h IS on the machine (in the PSDK) folder.

And no, it looks like classpath environment variables were NOT set automatically during the installation. So the question is what to do now.


[Edited by - CombatHammie on December 15, 2006 6:11:52 PM]
Quote:Original post by CombatHammie
Thanks bubu, I completely forgot that GLUT is seperate.

Nevertheless, it's just a side thing. GL.h IS on the machine (in the PSDK) folder.

And no, it looks like classpath environment variables were NOT set automatically during the installation. So the question is what to do now.


After you've got glut.h being found what errors do you get? If it says you're missing gl.h or glu.h simply go to Tools->Options, then under the Projects and Solutions node click on VC++ Directories and then add the directories to the PSDK under the right list ("Executable Files", "Include Files", etc.) [smile]

For example, I had to manually add "C:\Program Files\Microsoft Platform SDK\Include" into my "Include Files" list.
Quote:Original post by common
Quote:Original post by CombatHammie
Thanks bubu, I completely forgot that GLUT is seperate.

Nevertheless, it's just a side thing. GL.h IS on the machine (in the PSDK) folder.

And no, it looks like classpath environment variables were NOT set automatically during the installation. So the question is what to do now.


After you've got glut.h being found what errors do you get? If it says you're missing gl.h or glu.h simply go to Tools->Options, then under the Projects and Solutions node click on VC++ Directories and then add the directories to the PSDK under the right list ("Executable Files", "Include Files", etc.) [smile]

For example, I had to manually add "C:\Program Files\Microsoft Platform SDK\Include" into my "Include Files" list.




I'll deal with glut later, right now I can't even compile anything with gl.h

I added the directories as needed. There is a file that has to be edited, I know for sure that that's the reason behind the problem. What are the files that have to be added? (opengl32.lib is one of them)

This topic is closed to new replies.

Advertisement