fatal error C1083: 无法打开包括文件:stdafx.h

 时间:2024-10-25 16:54:32

1、新建一个控制台应用程序

2、将以下语句复制到主文件中#include "stdafx.h"#include <iostream>#in艘早祓胂clude<gl/glut.h> using namespace std;void renderScene(void){ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glLoadIdentity(); glBegin(GL_TRIANGLES); glVertex3f(-0.5, -0.5, 0.0); glVertex3f(0.5, 0.0, 0.0); glVertex3f(0.0, 0.5, 0.0); glEnd(); glutSwapBuffers();}int _tmain(int argc, _TCHAR* argv[]){ glutInit(&argc, (char**)argv); glutInitDisplayMode(GLUT_DEPTH | GLUT_DOUBLE | GLUT_RGBA); glutInitWindowPosition(100, 100); glutInitWindowSize(320, 320); glutCreateWindow("Hello OpenGL"); glutDisplayFunc(renderScene); glutMainLoop();//enters the GLUT event processing loop. system("pause"); return 0;}

3、编译运行即可通过

  • Visual Studio 2019怎么创建桌面图标
  • VS如何开启解决方案资源管理器
  • vs怎么创建一个新的项目
  • vs写完代码怎么运行
  • Visual Studio 工作负荷怎么选择
  • 热门搜索
    母亲手抄报大全 六一手抄报简单又好画 母亲节手抄报大全 英语手抄报边框 同讲普通话携手进小康手抄报内容 英语手抄报的内容 四年级安全手抄报 法制手抄报图片大全 五一手抄报图片 手抄报花边漂亮边框