Does anyone know why this isn't building?
When building I get 3 error(s).
In the project settings I set the Linker -> System -> SUBSYSYSTEM:Windows
Code:
#include <Windows.h>
#include <gl/glut.h>
void display()
{
glClear(GL_COLOR_BUFFER_BIT);
glBegin(GL_TRIANGLES);
glVertex2f(-0.5f, -0.5f);
glVertex2f(0.5f, -0.5f);
glVertex2f(0.0f, 0.5f);
glEnd();
glFlush();
}
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB);
glutInitWindowSize(500, 500);
glutCreateWindow("OpenGL Test");
glutDisplayFunc(display);
glutMainLoop();
return 0;
}Code:
argument of type "char *" is incompatible with parameter of type "char **"
expected an expression
subscript requires array or pointer type
expected an expression before ']'