Hello,
I'm trying to compile a program that has header files within 2 folders of the current path.
Something like this,
#include <stdbool.h> #include <stdint.h> #include "inc/hw_ints.h" #include "inc/hw_memmap.h" #include "inc/hw_sysctl.h" #include "inc/hw_types.h" #include "inc/hw_uart.h" #include "driverlib/debug.h" #include "driverlib/interrupt.h" #include "driverlib/uart.h"
I have header files within inc folder and driverlib folder. Each file within these folders were added to the Source group.
After going through a few threads on the forum I also tried adding my include paths at, Projects- Options for Target-c/c++ tab-Include paths {.\driverlib;.\inc}
Despite all this I'm still receiving compiler errors, such as
driverlib\lcd.c(50): error: #5: cannot open source input file "inc/hw_memmap.h": No such file or directory
What is the best course of action?
Thank you
Note that you need to be careful with #include "non-absolute-name.h" for includes unless the compiler have been given an absolute include search path to the parent directory.
Else you can get a situation where "<projectdir>/main.c" looks for "<projectdir>/driverlib/hw_memmap.h" "<projectdir>/driverlib/lcd.c" looks for "<projectdir>/driverlib/driverlib/hw_memmap.h"