1 year ago

#113919

test-img

PrimeNumbrs

why does linker error keep happening even though I set the AdditionalDependencies already?

I was following the OpenGL tutorial from Freecodecamp.org (https://www.youtube.com/watch?v=45MIykWJ-C4) and I got this error while following the "Window" part of the tutorial.

#include <iostream>
#include <glad/glad.h>
#include <GLFW/glfw3.h>

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, 800, "openGLTest", NULL, NULL);

    if (window == NULL)
    {
        std::cout << "Failed to create GLFW window" << std::endl;
        glfwTerminate();
        return -1;
    }
    glfwMakeContextCurrent(window);


    gladLoadGL();
    
    

    glViewport(0, 0, 800, 800); //error starts when I wrote this

    glClearColor(0.07f, 0.13f, 0.17f, 1.0f);
    glClear(GL_COLOR_BUFFER_BIT);
    glfwSwapBuffers(window);


    while (!glfwWindowShouldClose(window))
    {
        glfwPollEvents();
    }


    glfwDestroyWindow(window);

    glfwTerminate();
    return 0;
}

This error keeps happening even though my Additional Dependencies is set to glfw3.lib;opengl32.lib;%(AdditionalDependencies).

opengl

lnk2019

lnk2001

0 Answers

Your Answer

Accepted video resources