谁能帮我解决以下错误
GL/glut.h 没有这样的文件或目录
我做的事情是
- 安装 MinGW 后,我已将路径添加到路径环境变量
- 将“glut.h”添加到 C:\MinGW\Include\GL
- 将 glut32.dll 添加到 C:\Windows\SysWOW64
- 将 glut32.lib 添加到项目文件夹中
- 与 'g++ -o hello.exe -Wall hello.c glee.lib glut32.lib -lopengl32 -lglu32' 编译
上面的错误仍然存在,请帮忙
#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();
}