title: OpenGL, GLUT, Cygwin - failed to open display ''
body: <p>My "CMakeList.txt" file</p>
  
  <pre><code>cmake_minimum_required(VERSION 3.1)
  project(butler)
  
  #########################################################
  # FIND GLUT
  #########################################################
  
  find_package(GLUT REQUIRED)
  include_directories(${GLUT_INCLUDE_DIRS})
  link_directories(${GLUT_LIBRARY_DIRS})
  add_definitions(${GLUT_DEFINITIONS})
  if(NOT GLUT_FOUND)
      message(ERROR " GLUT not found!")
  endif(NOT GLUT_FOUND)
  #########################################################
  # FIND OPENGL
  #########################################################
  find_package(OpenGL REQUIRED)
  include_directories(${OpenGL_INCLUDE_DIRS})
  link_directories(${OpenGL_LIBRARY_DIRS})
  add_definitions(${OpenGL_DEFINITIONS})
  if(NOT OPENGL_FOUND)
      message(ERROR " OPENGL not found!")
  endif(NOT OPENGL_FOUND)
  
  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
  
  set(SOURCE_FILES main.cpp)
  add_executable(butler ${SOURCE_FILES})
  target_link_libraries(butler ${OPENGL_LIBRARIES} ${GLUT_LIBRARY} )
  </code></pre>
  
  <p>And some example from Internet:</p>
  
  <pre><code>#include &lt;windows.h&gt;
  #include &lt;cstdlib&gt;
  #include "GL/glut.h"
  
  float clr = 0.2;
  
  void display() {
      glClear(GL_COLOR_BUFFER_BIT);
  
      clr += 0.1;
      if (clr &gt; 1.0)
          clr = 0;
      glBegin(GL_POLYGON);
      {
          glColor3f(clr, clr, clr);
          glVertex2f(-0.5, -0.5);
          glVertex2f(-0.5, 0.5);
          glVertex2f(0.5, 0.5);
          glVertex2f(0.5, -0.5);
      }
      glEnd();
  
      glFlush();
  }
  
  // Main execution  function
  int main(int argc, char *argv[]) {
      glutInit(&amp;argc, argv);      // Initialize GLUT
      glutCreateWindow("win1");   // Create a window 1
      glutDisplayFunc(display);   // Register display callback
      glutCreateWindow("win2");   // Create a window 2
      glutDisplayFunc(display);   // Register display callback
  
      glutMainLoop();             // Enter main event loop
  }
  </code></pre>
  
  <p>and I have error: "freeglut (/some/path/to/Debug/butler): failed to open display ''". I try to add DISPLAY variable with ':0.0' value but have error "freeglut (/some/path/to/Debug/butler): failed to open display ':0.0'"</p>