can any one help me with the following error
GL/glut.h no such file or directory
The things I did are
and still the error above persist please help
#include<GL/glut.h>
#include<iostream>
//#include<conio.h>
void render(void);
void keyboard(unsigned char c, int x, int y);
void mouse(int button, int state, int x, int y);
int main(int argc, char** atgv)
{
glutInit(&argc, argv);
glutInitDisplayMode( GLUT_DEPTH | GLUT_DOUBLE | GLUT_RGBA);
glutInitWindowPosition(100, 100);
glutInitWindowSize(640, 480);
glutCreateWindow("Sample GLUT Application");
glutDisplayFunc(render);
glutKeyboardFunc(keyboard);
glutMouseFunc(mouse);
glutMainLoop();
}
void keyboard(unsigned char c, int x, int y)
{
if(c == 27){
exit(0);
}
}
void mouse(int button, int state, int x, int y)
{
if(button == GLUT_RIGHT_BUTTON )
{
exit(0);
}
}
void render(void)
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
glBegin(GL_TRIANGLES);
glColor3f(1, 0, 0);
glVertex2f(-0.5, -0.5);
glColor3f(0, 1, 0);
glVertex2f(0.5, -0.5);
glColor3f(0, 0, 1);
glVertex2f(0.0, 0.5);
glEnd();
glutSwapBuffers();
}
some simple things that can cause problems in my experience (so make sure they are set!:) :
C:\MinGW\bin
is in your path variable if not, add C:\MinGW\bin
to your PATH (type %path% in a console window to ensure the path property is applied to the window console session you are using)glut32.dll
into C:\windows\system32
so it can be located at runtime, or place it in the same directory as the executable you wish to runglut32.dll
in c:\mingw\bin
libglut32.a
in c:\mingw\lib
glut.h
should be in c:\mingw\include\GL
Apologies for the previous omission.
That should see you alright provided there are no other issues at play.
Let me know if you need more info/help :)
Addendum:
I located this link which whilst old may be of use to you in making the files available to mingw's environment.
On a Debian based systems such as Ubuntu, do
sudo apt-get install libglfw3-dev libgl1-mesa-dev libglu1-mesa-dev
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With