# GLFW/glfw3.h: No such file or directory, g++, Mate 18.1

**URL:** <https://discourse.glfw.org/t/glfw-glfw3-h-no-such-file-or-directory-g-mate-18-1/924>\
**Category:** support\
**Created:** [June 27, 2017, 3:13pm UTC](https://discourse.glfw.org/t/glfw-glfw3-h-no-such-file-or-directory-g-mate-18-1/924 "2017-06-27T15:13:33Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![mglfwan](https://avatars.discourse-cdn.com/v4/letter/m/d2c977/32.png) [@mglfwan](https://discourse.glfw.org/u/mglfwan)\
**Post date:** [June 27, 2017, 3:13pm UTC](https://discourse.glfw.org/t/glfw-glfw3-h-no-such-file-or-directory-g-mate-18-1/924/1 "2017-06-27T15:13:33Z")

</div>

Hi,  
I’m new to GLFW and wan’t to try some example code but I can’t compile any. My example c++ code has `#include <GLFW/glfw3.h>`. I try to compile it with `g++ ./test.cpp -lglfw`. If i do so, i get the error:  
`GLFW/glfw3.h: No such file or directory`  
Already search with google but didn’t found anything what worked for me. Using Linux Mate 18.1.

I installed (sudo apt-get install) libglfw2, 3, 3-dev, 3-doc, -dev,  
also libglfw-dev libglm-dev libglew1.13 build-essential libevent-pthreads-2.0.5 doxygen xorg-dev libglu1-mesa-dev  
(i know its not the newest version of GLFW but I would like to start working with this)

Any idea what I need to do? Need to add some Path? where it is located? filesearch take ages…and find nothing

Thanks

---

<div class="post-metadata">

**Author:** ![tombsar](https://avatars.discourse-cdn.com/v4/letter/t/db5fbb/32.png) [@tombsar](https://discourse.glfw.org/u/tombsar)\
**Post date:** [June 27, 2017, 4:00pm UTC](https://discourse.glfw.org/t/glfw-glfw3-h-no-such-file-or-directory-g-mate-18-1/924/2 "2017-06-27T16:00:46Z")

</div>

On Linux the header files should normally be in `/usr/include/GLFW`, but the compile error suggests that they are not there. Older versions of glfw were stored in `/usr/include/GL` instead, in which case your include line needs to be changed to `#include <GL/glfw.h>`.

Another possibility is `/usr/local/include/GLFW`, but that is unlikely if you installed through a package manager rather than manually.

If you have `locate` installed, try searching for them with `locate glfw3.h` in your shell of choice.

---

<div class="post-metadata">

**Author:** ![mglfwan](https://avatars.discourse-cdn.com/v4/letter/m/d2c977/32.png) [@mglfwan](https://discourse.glfw.org/u/mglfwan)\
**Post date:** [June 27, 2017, 4:53pm UTC](https://discourse.glfw.org/t/glfw-glfw3-h-no-such-file-or-directory-g-mate-18-1/924/3 "2017-06-27T16:53:40Z")

</div>

Thanks!  
i had nothing in /GLFW but in /GL. There as you noted only glfw.h.  
I tried locate (also thanks for that hint) without any result for glfw3.h. So I installed again. After this I have glfw3.h in /GLFW but nothing in /GL anymore. It seems it removes newer version if you install older. and older if you install newer.

Ok, now it can find the header. But I get some different errors like:

error: ‘GLFW\_NO\_API’ was not declared in this scope  
glfwWindowHint(GLFW\_CLIENT\_API, GLFW\_NO\_API)

and locate glfw3.h hast still no output

---

<div class="post-metadata">

**Author:** ![mmozeiko](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.glfw.org/mmozeiko/32/29_2.png) [@mmozeiko](https://discourse.glfw.org/u/mmozeiko)\
**Post date:** [June 27, 2017, 5:08pm UTC](https://discourse.glfw.org/t/glfw-glfw3-h-no-such-file-or-directory-g-mate-18-1/924/4 "2017-06-27T17:08:30Z")

</div>

GLFW\_NO\_API was introduced in version 3.2: [http://www.glfw.org/changelog.html](http://www.glfw.org/changelog.html)

Do you have at least version 3.2?

If your distributions glfw is too old, then simply build glfw from latest release and link statically to it.

---

<div class="post-metadata">

**Author:** ![dougbinks](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.glfw.org/dougbinks/32/39_2.png) [@dougbinks](https://discourse.glfw.org/u/dougbinks)\
**Post date:** [June 27, 2017, 5:10pm UTC](https://discourse.glfw.org/t/glfw-glfw3-h-no-such-file-or-directory-g-mate-18-1/924/5 "2017-06-27T17:10:38Z")

</div>

[GLFW version 3.2 is required for GLFW\_NO\_API](http://www.glfw.org/changelog.html). Are you able to get version 3.2 via apt-get? Otherwise you can [download and build a source package](http://www.glfw.org/download.html).

---

<div class="post-metadata">

**Author:** ![mglfwan](https://avatars.discourse-cdn.com/v4/letter/m/d2c977/32.png) [@mglfwan](https://discourse.glfw.org/u/mglfwan)\
**Post date:** [June 27, 2017, 5:14pm UTC](https://discourse.glfw.org/t/glfw-glfw3-h-no-such-file-or-directory-g-mate-18-1/924/6 "2017-06-27T17:14:43Z")

</div>

Ah ok, good to know, thanks. It’s only version 3.  
it was just example good, not sure if I need it. I will try other code which works with version 3 then first.

e.g. this one:  
[http://www.glfw.org/documentation.html](http://www.glfw.org/documentation.html)

(glClear no reference, if i add -lGL it can compile (g++ ./test.cpp -lglfw -lGL)

ok. compiled without error  
but if I start the program nothing happens. I instantly get back to console.

Edit: with apt-get I can only get version 3. Thanks for links but I would like to start with apt-get version. If I install something new other things can go wrong :). And program should also work on computer which have only version 3.

EDIT2: IT IS WORKING NOW  
(for some reason I need to restart my PC first)  
thanks all for your help
