Jump to content
  • Advertisement
Sign in to follow this  
inspired78

URGENT - Header file problem. Solution please!

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

Hi, I am using Visual Studio 2005 (version 8) on a Windows XP operating system. Whenever I build my solution, it says it “cannot open include file: ‘gl.h’: no such file or directory”. I have put all my include files where they are supposed to be – I think! What should I do to get my program to work? It’s very urgent… I started off the code like this: #include <windows.h> #include <gl.h> #include <glu.h> #include <glut.h> #include <stdlib.h> #include <stdio.h> I hope to hear from someone soon! Thank you.

Share this post


Link to post
Share on other sites
Advertisement
Solution Explorer -> Right click project -> Configuration Properties -> C/C++ -> Additional Include Directories -> Add the folder containing gl.h

Share this post


Link to post
Share on other sites
Since you don't mention errors regarding windows.h, I imagine you have the PSDK. By default, the GL headers are installed in the GL subdirectory of the PSDK include directory (which appears to be configured properly within VS, based on the aforementioned observation).

Consequently, in addition to the above poster's recommendation, you can probably solve the problem by using "gl/gl.h" and the like for the include strings, instead of just "gl.h"

This tends to be more idiomatic for Windows OpenGL development in my (admittedly limited) experience with GL code.

Share this post


Link to post
Share on other sites
Yes, you should use #include <GL/gl.h>.

There's no need to add the VS2005 include directory's "GL" subdirectory to the header search paths.

Share this post


Link to post
Share on other sites
Quote:
Original post by Ravuya
Yes, you should use #include <GL/gl.h>.

There's no need to add the VS2005 include directory's "GL" subdirectory to the header search paths.


I agree, which idiot said about search paths!? :-/
Although (in a vague effort to redeem myself) you might find after this step during linking you have to add the .lib files search path in a similar manner.

Share this post


Link to post
Share on other sites
Despite adding in the sub directory, changing it to <gl/glut.h> its STILL reporting errors. now its saying it cannot find the 'glaux' file even though its in the same PSDK folder as all the others (gl, glu...).

Then it reports tings like 'identifier not initialized'...'too many initializers', 'glOrtho' : redefinition; previous definition was 'function'...and so on.

WHAT IS GOING ON?! When i run another code with these headings, it works - but wid mine it doesnt!! this is a friends code that works:
#include <windows.h>
#include <stdio.h>
#include <gl\gl.h>
#include <gl\glu.h>
#include <gl\glaux.h>

See! its exactly like mine really!!

This really needs to work, its for a school project...I hope you can help me!

[Edited by - inspired78 on September 26, 2007 6:52:14 PM]

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!