2

我正在尝试为 nRF51422 芯片编译一个“blinky”程序,并且我一直在 Cygwin 中使用 CMake 来创建 makefile。(请记住,我是新手。)

这是我的 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")

运行 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

我知道 nrf_delay 位于 /nRF_Drivers/1.2.1/hal 文件夹中,那我做错了什么?

4

1 回答 1

2

如前所述:

  • make -j1 VERBOSE=1使用The builds with one thread构建您的项目,-j1旨在将编译器输出和错误消息保持在一起
  • 必须更正错误消息之前的编译器调用
  • 查看包含并使用您期望的路径重新运行它
于 2015-10-02T11:33:15.940 回答