Additional include directories

Hi,
How to set ’ Additional include directories ’ ?
I copy a folder ’ Sourse ’ to the helloworld component , which included the .c file and .h file. And try to built the project, but it was failed. See Screenshot below:

Thanks.

Regards!

.c and .h files paths:

Hi @lumao,

Try adding the following to your .cdef file:

sources:
{
    helloworldComponment.c
    $CURDIR/Sourse/led_blinks.c
    $CURDIR/Sourse/gps_bsp.c
}
cflags:
{
    -I$CURDIR/Sourse
}

Where $CURDIR is an environment variable pointing to the current directory, which relative to the .cdef file is the component’s directory.

The cflags part is so that the any header files in /Sourse are accessible to the compiler.

Hope this helps.

Raf

2 Likes

Raf,

Perfect ! Thank you very much!

Regards!