ProjectDude
ProjectDude

Reputation: 21

Can't find header file with cmake

I'm trying to compile a 'blinky' program for the nRF51422 chip, and I've been using CMake in Cygwin to create the makefile. (Bear in mind, I'm new at this.)

Here's my CMakeLists:

cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
set(CMAKE_LEGACY_CYGWIN_WIN32 0)

project("nRF51422 Blinky" C)

add_executable(nRF51 main.c)
target_include_directories(nRF51 PUBLIC "X:/Documents/TestCompilation/RTE")
target_include_directories(nRF51 PUBLIC "X:/Programs/Keil_v5/ARM/Pack/ARM/CMSIS/4.2.0/CMSIS/Include")
target_include_directories(nRF51 PUBLIC "X:/Programs/Keil_v5/ARM/Pack/NordicSemiconductor/nRF_DeviceFamilyPack/1.1.4/Device/Include")
target_include_directories(nRF51 PUBLIC "X:/Programs/Keil_v5/ARM/Pack/NordicSemiconductor/nRF_Drivers/1.2.1/hal")
target_include_directories(nRF51 PUBLIC "X:/Programs/Keil_v5/ARM/Pack/NordicSemiconductor/nRF_Examples/7.2.0/bsp")

And I get this error when running cmake -G"Unix Makefiles" && make:

~/blinky/main.c:24:23: fatal error: nrf_delay.h: No such file or directory
#include "nrf_delay.h"
                      ^
compilation terminated

I know that the nrf_delay is located in the /nRF_Drivers/1.2.1/hal folder, so what am I doing wrong?

Upvotes: 2

Views: 1861

Answers (1)

Th. Thielemann
Th. Thielemann

Reputation: 2824

As already mentioned:

  • Build your project with make -j1 VERBOSE=1 The -j1 builds with one thread and aims to keep compiler output and error message together
  • The compiler call before the error message must be corrected
  • Review the includes and re-run it with the paths your are expecting

Upvotes: 2

Related Questions