LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 09-26-2007, 08:26 AM   #1
inspired78
LQ Newbie
 
Registered: Sep 2007
Posts: 2

Rep: Reputation: 0
URGENT - OpenGl header error. Solution please!


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.
 
Old 09-26-2007, 11:31 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
please do not mark threads as urgent, they are not urgent for any of the members of this site who kindly donate their time to help others. additionally whilst this subform is operating system agnostic, this is a linux based site, so you aren't best placed to get much of an answer for a very Microsoft centric issue.
 
Old 09-26-2007, 06:33 PM   #3
inspired78
LQ Newbie
 
Registered: Sep 2007
Posts: 2

Original Poster
Rep: Reputation: 0
cool

ok thank you
 
Old 09-27-2007, 02:58 AM   #4
fcdev
Member
 
Registered: Sep 2005
Posts: 47

Rep: Reputation: 15
Assuming Visual Studio 2005 actually supports OpenGL, you need to fix your include statements ... gl.h is located in a 'GL' sub-folder of the includes folder ... change your code to look like this ...

#include <GL/gl.h>
#include <GL/glu.h>
#include <GL/glut.h>
#include <stdlib.h>
#include <stdio.h>

That should help. The next problem you may encounter is GL/glut.h may not be found ... In the past, I've had to download and install a copy of GLUT manually ... try http://freeglut.sourceforge.net/ but beware, it can be a pain in the neck to get it working if you can't find a simple Windows installer. Finally, you need to add the appropriate OpenGL, GLU, and GLUT libraries to your project.

Alternatively, use Linux as your Operating System, and you'll find that OpenGL is MUCH, MUCH easier to use.

Last edited by fcdev; 09-27-2007 at 03:46 AM. Reason: extra info about GLUT
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Error while parsing chunk header. Mplayer error only under Slack vdemuth Linux - Software 5 02-19-2007 11:09 AM
Missing header GLTK in compiling an openGL program BorgAssimilator Programming 1 01-23-2006 09:07 PM
'error 2 reading header' error message from installer pauln600 Fedora - Installation 1 01-10-2006 09:00 AM
OpenGL Header Files daclam Linux - Software 2 08-07-2004 10:01 PM
OpenGL header file not found haruki_zaemon Linux - Software 1 08-18-2003 09:21 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:36 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration