Error: win is undefined

163 views Asked by At

So I'm trying to follow a tutorial but when I get to around 13:00 mins in, I get an error which says

win is undefined

I know what this means of course, but I didn't find anything in his episode where he defines win. I'm really stuck for answers and could use some help!

void key_callback(GLFWwindow * window, int key, int scancode, int action, int mods)
    {
        window* win = (window*) glfwGetWindowUserPointer(window);
    }

Could you please stop down voting my comment? My comment is asking a question that yous clearly think is a type error or something along the lines.

*Edit:Edit: I figured it out. In Solution directory, there were a )/ after configuration, I changed it to )\ and changed visual studio to 64x and it fixed it. Oh, and could you please remove these down votes? Thanks.

2

There are 2 answers

4
ganeshvjy On

Two changes: 1. Remove the semicolon after (window*) 2. Change window* to Window* with Capital W

void key_callback(GLFWwindow * window, int key, int scancode, int action, int mods)
{
        Window* win = (Window*) glfwGetWindowUserPointer(window);  
}
0
Unknown. On

Edit: I figured it out. In Solution directory, there were a )/ after configuration, I changed it to )\ and changed visual studio to 64x and it fixed it.