glutKeyboardFunc() causing Access Violation error

So i’ve tried to add some input handling to my project, and created new header for that. I made initialization function which calls glutKeyboardFunc() for keyboard handling. As a parameter I used my own made void function: void keyboard_func(unsigned char key, int mouse_x, int mouse_y);, and it shouldn’t cause that violation error. So I’m asking, what would cause it? And btw, the initialization function is in .cpp file of course :3

Ok found the problem which cause that memory error: It probably couldn’t initialize the keyboard function before display function, and then causing memory error