OpenGL Visual Studio 2019 配置

1 C2182 “APIENTRY”:非法使用"void" 类型

下面的未定义

glClearColor(0, 0, 0, 1);  // (In fact, this is the default.)
glClear(GL_COLOR_BUFFER_BIT);

glBegin(GL_TRIANGLES);
glColor3f(1, 0, 0); // red
glVertex2f(-0.8, -0.8);

OpenGL Visual Studio 2019 配置_第1张图片

OpenGL Visual Studio 2019 配置_第2张图片

解决方案:
加上一个头文件:

#include 

你可能感兴趣的:(OpenGL,visual,studio,c++,ide)