# Cannot find header files during compilation; dependencies managed by Hunter

**URL:** <https://discourse.cmake.org/t/cannot-find-header-files-during-compilation-dependencies-managed-by-hunter/1798>\
**Category:** Code\
**Created:** [September 8, 2020, 8:50pm UTC](https://discourse.cmake.org/t/cannot-find-header-files-during-compilation-dependencies-managed-by-hunter/1798 "2020-09-08T20:50:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![govi218](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/g/45deac/32.png) [@govi218](https://discourse.cmake.org/u/govi218)\
**Post date:** [September 8, 2020, 8:50pm UTC](https://discourse.cmake.org/t/cannot-find-header-files-during-compilation-dependencies-managed-by-hunter/1798/1 "2020-09-08T20:50:50Z")

</div>

Here is my top level CMakeLists.txt. I build it using `cmake -H. -B_builds -DHUNTER_STATUS_DEBUG=ON -DCMAKE_BUILD_TYPE=Release `:

```auto
cmake_minimum_required(VERSION 3.2)

set(
    CMAKE_TOOLCHAIN_FILE
    "${CMAKE_SOURCE_DIR}/cmake/toolchain/cxx17.cmake"
    CACHE
    FILEPATH
    "Default toolchain"
)

include("cmake/HunterGate.cmake")

HunterGate(
    URL https://github.com/soramitsu/soramitsu-hunter/archive/v0.23.254-soramitsu1.tar.gz
    SHA1 7819e7dd14f58b6df2fd7f2bc835265d60add3f5
    FILEPATH "${CMAKE_SOURCE_DIR}/cmake/Hunter/config.cmake"
)

# set the project name
project(QToken-CPP)

# fetch packages
hunter_add_package(Boost COMPONENTS regex system filesystem)
hunter_add_package(GTest)
hunter_add_package(libp2p)

# add them to the project
find_package(GTest CONFIG REQUIRED) # GTest::main
find_package(Boost CONFIG REQUIRED regex system filesystem)
find_package(libp2p CONFIG REQUIRED) # GTest::main

# add srcs and headers
set(SOURCES src/main.cpp src/chunker.cpp src/factory.cpp)
set(HEADERS src/chunker.hpp src/factory.hpp src/kadMain.hpp)

# add the executable
add_executable(VIN ${SOURCES} ${HEADERS})
target_link_libraries(VIN
    PRIVATE
        libp2p
)

# testing
enable_testing()
add_subdirectory(test)

```

When I run `cmake --build _builds --config Debug` it gives me:

```auto
[10%] Building CXX object CMakeFiles/VIN.dir/src/main.cpp.o
In file included from /home/gov/dev/qtoken-cpp/src/main.cpp:8:
/home/gov/dev/qtoken-cpp/src/kadMain.hpp:10:10: fatal error: libp2p/common/literals.hpp: No such file or directory
   10 | #include <libp2p/common/literals.hpp>
      | ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [CMakeFiles/VIN.dir/build.make:82: CMakeFiles/VIN.dir/src/main.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:176: CMakeFiles/VIN.dir/all] Error 2
make: *** [Makefile:160: all] Error 2

```

Am I linking the targets incorrectly?

---

<div class="post-metadata">

**Author:** ![govi218](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/g/45deac/32.png) [@govi218](https://discourse.cmake.org/u/govi218)\
**Post date:** [September 9, 2020, 9:55pm UTC](https://discourse.cmake.org/t/cannot-find-header-files-during-compilation-dependencies-managed-by-hunter/1798/2 "2020-09-09T21:55:00Z")

</div>

Solved; I didn’t realize the target to be linked was `p2p` and not `libp2p`.
