我正在尝试编译下面的代码以启动 OpenGL 类并且构建失败。我能做些什么来纠正这个问题?它与链接器有关吗?
#include <windows.h>
#include <gl/GL.h>
#include <gl/GLU.h>
//Drawing funciton
void draw(void)
{
//Background color
glClearColor(1,0,0,1);
glClear(GL_COLOR_BUFFER_BIT );
//Draw order
glutPostRedisplay();
glFlush();
}
//Main program
int main(int argc, char **argv)
{
glutInit(&argc, argv);
//Simple buffer
glutInitDisplayMode(GLUT_SINGLE | GLUT_RGBA );
glutInitWindowPosition(100,100);
glutInitWindowSize(800,400);
glutCreateWindow("Red window");
//Call to the drawing function
glutDisplayFunc(draw);
glutMainLoop();
return 0;
}