title: C++ GLFW Error solved by adding legacy_stdio_definitions.lib. Why?
body: <p>Can anyone of you explain to me why adding "legacy_stdio_definitions.lib" resolves an error when building the following program?
  The error occurred when I was trying to use the GLFW library.
  I am still pretty new to c++ and the OpenGL world and after hours of searching online and hours of trial and error I stumbled upon the suggestion to add "legacy_stdio_definitions.lib" to my additional dependencies. This did indeed solve the error <strong>but I still don't fully understand</strong> what the problem was and what this .lib did to solve it.</p>
  
  <p>I am using Microsoft Visual Studio 2015 Community Edition btw.</p>
  
  <p>All the steps that i did were:</p>
  
  <ol>
  <li>C/C++->General adding includes for glew, glm and glfw</li>
  <li>Linker->General adding glew and glfw libs</li>
  <li>Linker->Input added
  glew32.lib, glfw3.lib and legacy_stdio_definitions.lib</li>
  <li>added glew32.dll to my project folder</li>
  </ol>
  
  <hr>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  
  #include &lt;GL/glew.h&gt;
  
  #include &lt;GLFW/glfw3.h&gt;
  
  #include &lt;glm/glm.hpp&gt;
  using namespace glm;
  
  int main() {
  
      // Initialise GLFW
      if (!glfwInit())
      {
          fprintf(stderr, "Failed to initialize GLFW\n");
          return -1;
      }
  
      glfwWindowHint(GLFW_SAMPLES, 4); // 4x antialiasing
      glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3); // We want OpenGL 3.3
      glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);
      glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE); // To make MacOS happy; should not be needed
      glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); //We don't want the old OpenGL 
  
                                                                     // Open a window and create its OpenGL context
      GLFWwindow* window; // (In the accompanying source code, this variable is global)
      window = glfwCreateWindow(1024, 768, "Tutorial 01", NULL, NULL);
      if (window == NULL) {
          fprintf(stderr, "Failed to open GLFW window. If you have an Intel GPU, they are not 3.3 compatible. Try the 2.1 version of the tutorials.\n");
          glfwTerminate();
          return -1;
      }
      glfwMakeContextCurrent(window); // Initialize GLEW
      glewExperimental = true; // Needed in core profile
      if (glewInit() != GLEW_OK) {
          fprintf(stderr, "Failed to initialize GLEW\n");
          return -1;
      }
  
      // Ensure we can capture the escape key being pressed below
      glfwSetInputMode(window, GLFW_STICKY_KEYS, GL_TRUE);
  
      do {
          // Draw nothing, see you in tutorial 2 !
  
          // Swap buffers
          glfwSwapBuffers(window);
          glfwPollEvents();
  
      } // Check if the ESC key was pressed or the window was closed
      while (glfwGetKey(window, GLFW_KEY_ESCAPE) != GLFW_PRESS &amp;&amp;
          glfwWindowShouldClose(window) == 0);
  
  }
  </code></pre>
  
  <p>Any help will be appreciated.</p>