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 工作负荷怎么选择
  • 热门搜索
    基围虾怎么去虾线 怎么做视频 虚岁怎么算 皮沙发怎么清洗 怎么办理营业执照 怎么办营业执照 怎么查流量 格式刷怎么用 怎么关闭win10自动更新 third怎么读