This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Makefile not including files from Makefile.common

I can't figure out why but my build cannot locate files that are included in the makefile.common I'm using SDK 5.1.0 and the ble_app_hrs project. It seems it can't find one of the files in the source directory.

Here's the Error:

Description	Resource	Path	Location	Type
fatal error: app_error.h: No such file or directory	
battery.c	/ble_app_hrs_PCA10001	line 29	
make: *** [_build/battery.o] Error 1	ble_app_hrs_PCA10001		 

I've tried with the LED project provided and that seems to work. I used it as a template for my makefile. This leads me to believe that the makefile.common is ok. I haven't made any changes to it.

TARGET_CHIP := NRF51822_QFAA_CA
BOARD := BOARD_PCA10001

C_SOURCE_FILES += battery.c
C_SOURCE_FILES += led.c

OUTPUT_FILENAME := ble_app_hrs_gcc
SDK_PATH = ../../../../../


#Uncomment correct line if you have s110 programmed on the chip.
DEVICE_VARIANT := xxaa
#DEVICE_VARIANT := xxab

#USE_SOFTDEVICE := s110
#USE_SOFTDEVICE := s210

include $(SDK_PATH)Source/templates/gcc/Makefile.common
Parents
    1. Is your makefile in a sub-directory of ble_app_hrs_gcc? If you followed the pattern from the blinky example, it should be. One possible problem is your relative path is wrong.

    2. More likely is you are facing the same issue I was in that the common make file does not include all the paths you need. Try adding the line INCLUDEPATHS += -I"../../../../../../Include/app_common" and see if you get a different error. If so, you just need to add all the necessary include paths either in your local makefile or in makefile.common.

Reply
    1. Is your makefile in a sub-directory of ble_app_hrs_gcc? If you followed the pattern from the blinky example, it should be. One possible problem is your relative path is wrong.

    2. More likely is you are facing the same issue I was in that the common make file does not include all the paths you need. Try adding the line INCLUDEPATHS += -I"../../../../../../Include/app_common" and see if you get a different error. If so, you just need to add all the necessary include paths either in your local makefile or in makefile.common.

Children
    1. Yes it's in the gcc subdirectory

    2. It seems to find app_error.h but now app_error is looking for nrf_error which is in the Include/s110/ folder. I've added that as well to the makefile but it still can't seem to find it. [code type="xml"]In file included from ../battery.c:29:0: ../../../../../Include/app_common/app_error.h:27:23: fatal error: nrf_error.h: No such file or directory #include "nrf_error.h"[/code]

Related