Beginner OpenGl

this is my first program , Im using linux and i got error when I run it

fatal error: windows.h: No such file or directory
    1 | #include <windows.h>
      #include <Windows.h>
      #include <gl\gl.h>
      #include <gl\glu.h>
     #include <gl\glut.h>
   
    static void redraw (void);  
     
    int main (int argc, char (( argv);
    int main (int argc, char ** argv);
   
    {
   
    glutInit(&argc, argv);
    glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEAPTH);
   
    glutInitWindowPosition(100,100);
     glutInitWindowSize(400,400);
     glutCreateWindow("application11");
     glutDisplayFunc(redraw);
   
     glMatrixMode(GL_PROJECTION);
    gluPerspective(45,1.0,10.0,200.0);
    glutMainLoop();
    return 0;
   }
  
    static void redraw(void)
  
  {
  
      glClearColor(1.0,1.0,1.0,0.0);
      glClear(GL_COLOCR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
      glLOADIdenrity();
      glCOLOR3f(0.0,0.0,0.0);
      glTranslatef(-1.5f,0.0f,-100.0f);
      glColor3f(1.0,1.0,1.0);
      glBegin(GL_POLYGON);

       glVertex2f(-30,-30);
       glVertex2f(-30,30);
       glVertex2f(30,30);
       glVertex2f(30,-30);
       glEnd();
       glutSwapBuffers();
     }

So what’s your question?

Please see The Forum Posting Guidelines for tips on composing your posts. Tell us where you where you got this from, and what you have tried to resolve it, and why you think this should even build without mods on Linux?

This source code has a lot of errors in it.

windows.h is a Microsoft Windows header. You need to remove it when building on Linux. Also, Windows uses backslashes for path delimiters; Linux uses forward slashes. But Windows MSVC compiler will accept forward slashes too. Further, Linux pathnames/filenames are case sensitive, whereas in some cases Windows is case insensitive.

So I’d suggest you change your include directives to:

#ifdef _WIN32
#  include <windows.h>
#endif
#include <GL/gl.h>
#include <GL/glu.h>
#include <GL/glut.h>

Then you’ll have to deal with the other errors after the includes.

You may instead just want to ditch whatever source you’re currently using for this and flip to using one that both: 1) builds for Linux out-of-the-box, and 2) helps you learn Modern OpenGL not this legacy OpenGL. For instance, try:

The code builds and runs on Linux out-of-the-box. I just pulled the source code and re-verified that.