GLFW 3 window creation fails in windows 10

#include <GLFW\glfw3.h>
#include <iostream>

int main(){

GLFWwindow *window = glfwCreateWindow(640, 480, "Title", NULL, NULL);

if (!glfwInit) {
	std::cout << "GLFW initialization failed.";
if (!window) {
	std::cout << "Failure to create window.\n";

return 0;

Any ideas on how to fix this, glfwInit is true, but the window creation fails. I am using Visual Studio 2015 Community


You need to initialize glfw before creating window. Basically call to glfwInit() should be before call to glfwCreateWindow.

Also you are not calling glfwInit correctly - you need to have () parenthesis after function name. Just having glfwInit will make compiler to evaluate it as a function pointer.


thank you so much, it was very simple yet my brain just skipped over it.