To find a problem, you should comment out most of the code and start from basics.
Get empty window to show up, draw something on it.
Enable perspective code.
Replace test drawing with your cube.
And so on.
Not only you will find the error, but this way you will learn OpenGL easier. And you would ask much more specific questions