title: libGL errors when executing OpenGL program
body: <p>I get this error when I try to execute my program:</p>
  
  <pre><code>libGL error: unable to load driver: i965_dri.so
  libGL error: driver pointer missing
  libGL error: failed to load driver: i965
  libGL error: unable to load driver: swrast_dri.so
  libGL error: failed to load driver: swrast
  X Error of failed request:  GLXBadFBConfig
    Major opcode of failed request:  154 (GLX)
    Minor opcode of failed request:  34 ()
    Serial number of failed request:  42
    Current serial number in output stream:  41
  </code></pre>
  
  <p>My Code (I took it from the "OpenGL Development Cookbook" book) :</p>
  
  <pre><code>#include &lt;GL/glew.h&gt;
  #include &lt;GL/freeglut.h&gt;
  #include &lt;iostream&gt;
  
  const int WIDTH = 640;
  const int HEIGHT = 480;
  
  void OnInit()
  {
     glClearColor(1, 0, 0, 0);
     std::cout &lt;&lt; "Initialization successfull" &lt;&lt; std::endl;
  }
  
  void OnShutdown()
  {
     std::cout &lt;&lt; "Shutdown successfull" &lt;&lt; std::endl;
  }
  
  void OnResize(int nw, int nh)
  {
  
  }
  
  void OnRender()
  {
     glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
     glutSwapBuffers();
  }
  
  int main(int argc, char** argv)
  {
     glutInit(&amp;argc, argv);
     glutInitDisplayMode(GLUT_DEPTH | GLUT_DOUBLE | GLUT_RGBA);
     glutInitContextVersion(3, 3);
     glutInitContextFlags(GLUT_CORE_PROFILE | GLUT_DEBUG);
     glutInitContextProfile(GLUT_FORWARD_COMPATIBLE);
     glutInitWindowSize(WIDTH, HEIGHT);
     glutCreateWindow("OpenGL");
  
     glewExperimental = GL_TRUE;
     GLenum err = glewInit();
  
     if(GLEW_OK != err) {std::cerr &lt;&lt; "Error: " &lt;&lt; glewGetErrorString(err) &lt;&lt; std::endl; }
     else{if(GLEW_VERSION_3_3) {std::cout &lt;&lt; "Driver supports OpenGL 3.3\n Details: " &lt;&lt; std::endl; }}
  
     std::cout &lt;&lt; "\tUsing glew: " &lt;&lt; glewGetString(GLEW_VERSION) &lt;&lt; std::endl;
     std::cout &lt;&lt; "\tVendor: " &lt;&lt; glGetString(GL_VENDOR) &lt;&lt; std::endl;
     std::cout &lt;&lt; "\tRenderer: " &lt;&lt; glGetString(GL_RENDERER) &lt;&lt; std::endl;
     std::cout &lt;&lt; "\tGLSL: " &lt;&lt; glGetString(GL_SHADING_LANGUAGE_VERSION) &lt;&lt; std::endl;
  
     OnInit();
     glutCloseFunc(OnShutdown);
     glutDisplayFunc(OnRender);
     glutReshapeFunc(OnResize);
     glutMainLoop();
     return 0;
  }
  </code></pre>
  
  <p>I verified if my driver supports the OpenGL version I am using with the <strong>glxinfo | grep "OpenGL"</strong> command:</p>
  
  <pre><code>OpenGL vendor string: Intel Open Source Technology Center
  OpenGL renderer string: Mesa DRI Intel(R) Sandybridge Mobile 
  OpenGL core profile version string: 3.3 (Core Profile) Mesa 10.5.9
  OpenGL core profile shading language version string: 3.30
  OpenGL core profile context flags: (none)
  OpenGL core profile profile mask: core profile
  OpenGL core profile extensions:
  OpenGL version string: 3.0 Mesa 10.5.9
  OpenGL shading language version string: 1.30
  OpenGL context flags: (none)
  OpenGL extensions:
  </code></pre>
  
  <p>I am using <strong>Ubuntu 14.04.3</strong>.</p>
  
  <p>I'm not sure but I think I get this error because I am using <strong>intel</strong> and not <strong>Nvidia</strong>.</p>