i just installed glfw and i was testing the little example project for creating a window, and it just dosn't work, when i create the window, it exits the programm with a "-1" cuz the window is not created, what can i do? Edit: I fixed it alone :) i just change the compiler to x86 and change a bit the code xd
#include <GL/glew.h>
#include <GLFW/glfw3.h>
#include <iostream>
int main(void)
{
/* Initialize GLFW Library */
if (!glfwInit()) {
std::cout<<"ERROR: While initializing GLFW!"<<std::endl;
exit(-1);
}
/* Create a windowed mode window and its OpenGL context */
auto* window = glfwCreateWindow(640, 480, "Hello World", NULL, NULL);
if (!window)
{
std::cout<<"ERROR: While creating Window Object!"<<std::endl;
glfwTerminate();
exit(-1);
}
/* Make the window's context current */
glfwMakeContextCurrent(window);
/* Initialize GLEW Library */
GLenum err = glewInit();
if (err != GLEW_OK) {
fprintf(stderr,"ERROR: %s\n",
glewGetErrorString(err));
exit(-1);
}
fprintf(stdout,"Using GLEW %s\n",
glewGetString(GLEW_VERSION));
//TODO: Create and compile shaders here (vertex and frament shaders)
// and finally draw something with moder OpenGL!
/* Loop until the user closes the window */
while (!glfwWindowShouldClose(window))
{
/* Render here */
glClear(GL_COLOR_BUFFER_BIT);
/* Swap front and back buffers */
glfwSwapBuffers(window);
/* Poll for and process events */
glfwPollEvents();
}
glfwTerminate();
exit(0);
}
You need to initialize glfw before creating a window
Call
glfwInit()beforeglfwCreateWindow