title: How to fix "unresolved external symbol _gladLoadGLLoader referenced in function _main" and "unresolved external symbol _glad_glViewport"?
body: <p>I keep getting the unresolved external symbol' error when building the program. However, the program compiles fine. I'm using the GLFW and GLAD libraries.</p>
  
  <pre><code>#include &lt;glad/glad.h&gt;
  #include &lt;GLFW/glfw3.h&gt;
  
  #include &lt;iostream&gt;
  
  void framebuffer_size_callback(GLFWwindow* window, int width, int height);
  
  //#undef main
  int main() {
      glfwInit();
      glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
      glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);
      glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
      GLFWwindow* window = glfwCreateWindow(800, 600, "LearningOpenGL", NULL, NULL);
  
      if (window == NULL) {
          std::cout &lt;&lt; "Failed To Create Window" &lt;&lt; std::endl;
          glfwTerminate();
          return -1;
      }
      glfwMakeContextCurrent(window);
  
      glfwSetFramebufferSizeCallback(window, framebuffer_size_callback);
  
      if (!gladLoadGLLoader((GLADloadproc)glfwGetProcAddress)) {
          std::cout &lt;&lt; "Failed to initialize GLAD" &lt;&lt; std::endl;
          return -1;
      }
  
      while (!glfwWindowShouldClose(window))
      {
          glfwSwapBuffers(window);
          glfwPollEvents();
      }
  
      glViewport(0, 0, 800, 600);
  
      glfwTerminate();
      return 0;
  }
  
  void framebuffer_size_callback(GLFWwindow* window, int width, int height) {
      glViewport(0, 0, width, height);
  }
  </code></pre>
  
  <p>I keep getting the same 2 errors:</p>
  
  <pre><code>Main.obj : error LNK2019: unresolved external symbol _gladLoadGLLoader referenced in function _main
  
  Main.obj : error LNK2001: unresolved external symbol _glad_glViewport
  </code></pre>