# How to include headers correctly when building statically? (Unix/CMake)

**URL:** <https://discourse.libcinder.org/t/how-to-include-headers-correctly-when-building-statically-unix-cmake/1862>\
**Category:** Using Cinder\
**Created:** [August 31, 2021, 9:25pm UTC](https://discourse.libcinder.org/t/how-to-include-headers-correctly-when-building-statically-unix-cmake/1862 "2021-08-31T21:25:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mango](https://avatars.discourse-cdn.com/v4/letter/m/ed655f/32.png) [@Mango](https://discourse.libcinder.org/u/Mango)\
**Post date:** [August 31, 2021, 9:25pm UTC](https://discourse.libcinder.org/t/how-to-include-headers-correctly-when-building-statically-unix-cmake/1862/1 "2021-08-31T21:25:13Z")

</div>

Hallo

I have just started to try this library today, but i am facing an issue when i try to statically compile on Manjaro, using CMake. I can link to the `libcinder.a` file, but when I include headers, It fails to recognize them. E.g. , If i try to add this header:

```auto
#include "cinder/gl/gl.h"

```

I get the following error:

```auto
fatal error: cinder/gl/gl.h: No such file or directory
    2 | #include "cinder/gl/gl.h"

```

Here is my CMake file:

```auto
cmake_minimum_required(VERSION 3.11)
set(CMAKE_CXX_STANDARD 17)

project(....)

include_directories("/Cinder/include/")
link_directories(Cinder/lib/linux/x86_64/ogl/Debug/)

add_executable(binary main.cpp)

target_link_libraries(binary -lGL -lpthread -lncurses -lX11 -lXxf86vm -lcinder)

```

BTW, I downloaded Cinder from git, and added it to the root of my project folder.  
Any ideas what I am doing wrong?  
Thank s

---

<div class="post-metadata">

**Author:** ![lithium](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.libcinder.org/lithium/32/38_2.png) [@lithium](https://discourse.libcinder.org/u/lithium)\
**Post date:** [September 1, 2021, 2:37am UTC](https://discourse.libcinder.org/t/how-to-include-headers-correctly-when-building-statically-unix-cmake/1862/2 "2021-09-01T02:37:27Z")

</div>

There’s a couple of cmake macros provided that should make building a cinder app a bit easier for you. Have a read of the [guides](https://libcinder.org/docs/guides/cmake/cmake.html#building-your-application-with-cmake) and hopefully they’ll point you in the right direction.

---

<div class="post-metadata">

**Author:** ![Mango](https://avatars.discourse-cdn.com/v4/letter/m/ed655f/32.png) [@Mango](https://discourse.libcinder.org/u/Mango)\
**Post date:** [September 1, 2021, 4:39am UTC](https://discourse.libcinder.org/t/how-to-include-headers-correctly-when-building-statically-unix-cmake/1862/3 "2021-09-01T04:39:57Z")

</div>

Thank for the link ! I’ll have a look at them
