Problem with ourShader

Hi, i’m new in this community, i also have a problem with ourShader details here.

error: ‘ourShader’ was not declared in this scope

(I’m tring to use glm to make a camera)

You need to provide more details than this for anyone to help you. Post the definition and usage of the ourShader symbol. Also describe what you’ve tried to resolve the problem yourself.

i saw this on a youtube video,
my code:

#define GLFW_DLL
#include <GLFW/glfw3.h>
#include <glm/glm.hpp>
#include <glm/ext.hpp>

int main(void)
{
    GLFWwindow* window;

    if (!glfwInit())
        return -1;

    window = glfwCreateWindow(640,480, "Prueba", NULL, NULL);
    if(!window){
        glfwTerminate();
        return -1;
    }
    glfwMakeContextCurrent(window);

    while(!glfwWindowShouldClose(window)){
        glClear(GL_COLOR_BUFFER_BIT);
        glm::mat4 view;
        view = glm::lookAt(glm::vec3(2.0f, 0.0f, 0.0f),
                        glm::vec3(0.0f, 0.0f, 0.0f),
                        glm::vec3(0.0f, 0.0f, 0.0f));
        ourShader.setMat4("view", view);

        glBegin(GL_TRIANGLES);
            glVertex2f(0,0);
            glVertex2f(1,0);
            glVertex2f(0,1);
        glEnd();
        glfwPollEvents();
        glfwSwapBuffers(window);
    }

    glfwTerminate();
    return 0;
}

This is a basic C/C++ usage problem, not an OpenGL problem. You need to read up on how to declare symbols defined outside of the current compilation unit.

i don’t know how that works, i only reed to apply the matrix to the “camera”