Error: "GL / glfw3.h: no such file or directory" when compiling C ++ programs using OpenGL on Linux

I get an error

GL/glfw3.h: No such file or directory

when I try to compile the sample program given in the tutorial here , the "Opening a window" section. I installed all the libraries to which they refer in the section "Building on Linux". (My distribution is Ubuntu 16.04.)

I also successfully completed

apt-get install libglfw-dev

as I found somewhere as an answer to this question.

I think the glfw3 library may have been installed in a place where the compiler does not know how to automatically access.

How do I know if this is so, where should I put it so that it can be accessed ( /usr/share?), And what exactly did I put there? I copied a file with the name libglfw3.athat I found in /usr/local/libbefore /usr/share, but the error was repeated.

I tried to compile it using g++ first.c -o first as well g++ first.c -lglut -lGL -lGLEW -lglfw -o first. This error message occurred at the same time (which makes me think that other libraries do not even need to be linked?)

I am a fairly new user. The solution is probably obvious.

+4
source share
1 answer

A simple fix (the solution was really obvious).

#include <GL/glfw3.h> it should be #include <GLFW/glfw3.h>

+4
source

Source: https://habr.com/ru/post/1651136/


All Articles