Hi, guys.
I just learn GLFW in today.
I type the code of this page http://www.glfw.org/documentation.html.
Compile with
gcc -Wall `pkg-config --cflags glfw3 glu` `pkg-config --static --libs glfw3 glu`
It’s done. And i run program. show nothing.
So, i modify the code to show error message.
#include <GLFW/glfw3.h>
#include <stdio.h>
int main(void)
{
GLFWwindow *window;
if (!glfwInit()) {
perror("glfwInit Error");
return -1;
}
window = glfwCreateWindow(640, 400, "Hello GLFW", NULL, NULL);
if (!window) {
perror("glfwCreatewindow Error");
glfwTerminate();
return -1;
}
glfwMakeContextCurrent(window);
while (!glfwWindowShouldClose(window)) {
glClear(GL_COLOR_BUFFER_BIT);
glfwSwapBuffers(window);
glfwPollEvents();
}
glfwTerminate();
return 0;
}
Recompile it and run it ,show the fllowing message:
glfwInit Error: No such file or directory
In this problem, how can i solve?
I don’t have any idea.
The GLFW
path and GLU
path doesn’t have problem.