title: GLFW: 'WGL: The driver does not appear to support OpenGL' error when creating window
body: <p>I am porting my simple lwjgl3 game to C++, and got <code>Error: WGL: The driver does not appear to support OpenGL</code>. The code is almost identical in java, so I'm wondering what's wrong and how to fix it:</p>
  
  <pre><code>int main(int argc, char** argv) {
      glfwSetErrorCallback(error_callback);
      if (!glfwInit()) {
          std::cerr &lt;&lt; "Failed to initialize GLFW" &lt;&lt; std::endl;
          return -1;
      }
  
      glfwDefaultWindowHints();
      //glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
      //glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 1);
      glfwWindowHint(GLFW_VISIBLE, GLFW_FALSE);
      glfwWindowHint(GLFW_RESIZABLE, GLFW_FALSE);
      glfwWindowHint(GLFW_SAMPLES, 4);
  
      GLFWwindow* window = glfwCreateWindow(640, 480, "Example", nullptr, nullptr);
      if (!window) {
          std::cerr &lt;&lt; "Failed to create window" &lt;&lt; std::endl;
          glfwTerminate();
          return -1;
      }
      ...
  </code></pre>
  
  <p>I am using <strong>msys2</strong> and <strong>mingw-w64</strong>, and compiled the program in mingw-w64 shell. First I thought the problem was with the glfw3 i built, so I used lwjgl3 copy of glfw instead and got the same error. I have tried the recommended hints, context versions, etc., but to no avail. I am pretty sure that the driver supports OpenGL, and just to make sure I also checked for updates.</p>
  
  <p>While testing stuff to see what works and doesn't, I have confirmed that all glfw and SFML examples are not working (both I have built with <em>mingw-w64</em>). No errors during compilation, no exceptions and/or errors in cmd, no window created as well.</p>
  
  <p>I'm not very familiar with windows development so I'm not sure if this is an issue with the mingw-w64, glfw or wgl.</p>