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

Started by
28 comments, last by CombatHammie 17 years, 4 months ago
Oh! Are you talking about the corewin_express.vsprops file?

If so you have to change it to add additional dependencies. Mine reads as such:
<?xml version="1.0"?><VisualStudioPropertySheet 	ProjectType="Visual C++" 	Version="8.00" 	Name="Core Windows Libraries">	<Tool 		Name="VCLinkerTool" 		AdditionalDependencies="kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib" /></VisualStudioPropertySheet>


EDIT: Find it in "C:\Program Files\Microsoft Visual Studio 8\VC\VCProjectDefaults" [smile]

I really hope that solves your problems!

EDIT2: A quick Google found this site: http://msdn.microsoft.com/vstudio/express/visualc/usingpsdk/
Advertisement
Quote:Original post by common
Oh! Are you talking about the corewin_express.vsprops file?

If so you have to change it to add additional dependencies. Mine reads as such:
<?xml version="1.0"?><VisualStudioPropertySheet 	ProjectType="Visual C++" 	Version="8.00" 	Name="Core Windows Libraries">	<Tool 		Name="VCLinkerTool" 		AdditionalDependencies="kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib" /></VisualStudioPropertySheet>


EDIT: Find it in "C:\Program Files\Microsoft Visual Studio 8\VC\VCProjectDefaults" [smile]

I really hope that solves your problems!


I already have all of those files listed. (I was under the impression that opengl had files of its own. Common, does that compile and work perfectly?

I went to MSDN's website, and it looks like a common problem. In fact, I tried putting #include <windows.h>... doesn't compile!!! :(

Is there are solution to this? I really don't want to spend my christmas vacation trying to figure it out, I want to study opengl instead.
Could you post all of your code and all of the contents of the output window?

EDIT: If you follow the instructions within the MSDN link in my last post you should be able to create a new Win32 project that is configured correctly. From there all you must do is link to the OpenGL library from within your project. (the #pragma comment(lib, "opengl32.lib") and #pragma comment(lib, "glu32.lib") statements, or in your project settings). Then from there your application should compile. I can't say anything more until I see what sort of errors you are getting.

The code is the first sample from Dave Astle's "Beginning OpenGL", he might be sour at me if I post the example here, who knows.

But the problem is not in the code, the problem occurs as soon as the compiler hits the include statement.

If I create an empty project, empty file and put an empty main() along with #include <gl.h>, compiler will terminate at the include statement and say that gl.h is not found.
Quote:Original post by CombatHammie
The code is the first sample from Dave Astle's "Beginning OpenGL", he might be sour at me if I post the example here, who knows.

But the problem is not in the code, the problem occurs as soon as the compiler hits the include statement.

If I create an empty project, empty file and put an empty main() along with #include <gl.h>, compiler will terminate at the include statement and say that gl.h is not found.


Okay, well the problem then is that the compiler simply cannot find the gl.h file, and this will have nothing to do with any unlinked libraries or anything else, simply that the compiler does not have the right folder to find that file.

Try to make sure that the include directory is pointing to the PSDK's include directory. Just go to Tools->Options then select VC++ Directories under Projects and Solutions then select "Include Files" press the folder icon to insert a new directory, then copy in or browse for the PSDK \Include directory.

If the build output says that it can't find an include it's just your paths are wrong, given that the file exists on your machine. It will explicitly tell you if there is a link error.

Also, make sure it's "#include <gl/gl.h>"
Quote:Original post by common
Quote:Original post by CombatHammie
The code is the first sample from Dave Astle's "Beginning OpenGL", he might be sour at me if I post the example here, who knows.

But the problem is not in the code, the problem occurs as soon as the compiler hits the include statement.

If I create an empty project, empty file and put an empty main() along with #include <gl.h>, compiler will terminate at the include statement and say that gl.h is not found.


Okay, well the problem then is that the compiler simply cannot find the gl.h file, and this will have nothing to do with any unlinked libraries or anything else, simply that the compiler does not have the right folder to find that file.

Try to make sure that the include directory is pointing to the PSDK's include directory. Just go to Tools->Options then select VC++ Directories under Projects and Solutions then select "Include Files" press the folder icon to insert a new directory, then copy in or browse for the PSDK \Include directory.

If the build output says that it can't find an include it's just your paths are wrong, given that the file exists on your machine. It will explicitly tell you if there is a link error.

Also, make sure it's "#include <gl/gl.h>"



That's exactly the problem. As I mentioned, I've done those things. I followed Microsoft's MSDN instructions to the letter... and it just won't work.

And yes, in the code it is gl\gl.h, I manually typed the sample here and forgot to put gl\.

This is very disappointing :( I was going to get a head start on OpenGL while college is out, but now I Am banging my head on the table.
Where are your gl.h and glu.h files located on your machine?
Quote:Original post by Jamil
Where are your gl.h and glu.h files located on your machine?


\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include\gl
Anyone?
Can you post your new errors?

This topic is closed to new replies.

Advertisement