(solved) addition to c_cpp_properties.json includePath not working

User avatar
mzimmers
Posts: 643
Joined: Wed Mar 07, 2018 11:54 pm
Location: USA

(solved) addition to c_cpp_properties.json includePath not working

Postby mzimmers » Mon Sep 13, 2021 5:22 pm

Hi all -

I added a line to my properties file :

Code: Select all

{
    "configurations": [
        {
            "name": "ESP-IDF",
            "compilerPath": "/home/mzimmers/.espressif/tools/xtensa-esp32-elf/esp-2020r3-8.4.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc",
            "cStandard": "c11",
            "cppStandard": "c++17",
            "includePath": [
                "/home/mzimmers/wiced/sdk/WICED-SDK-2.4.1/Wiced/WWD/include"
But I still get this error:

Code: Select all

In file included from ../main/i2d_app.h:16,
                 from ../main/i2d_app.c:28:
../main/wiced_structs.h:13:10: fatal error: wwd_constants.h: No such file or directory
 #include "wwd_constants.h"
when I try to build.

Code: Select all

#include "wwd_constants.h" // this doesn't work.
#include "/home/mzimmers/wiced/sdk/WICED-SDK-2.4.1/Wiced/WWD/include/wwd_constants.h" // this works.
What am I doing wrong?

Thanks...
Last edited by mzimmers on Tue Sep 14, 2021 3:38 pm, edited 1 time in total.

boarchuz
Posts: 604
Joined: Tue Aug 21, 2018 5:28 am

Re: addition to c_cpp_properties.json includePath not working

Postby boarchuz » Tue Sep 14, 2021 6:05 am

c_cpp_properties.json contains settings for Intellisense (auto complete, suggestions, code navigation, squiggles, etc). This doesn't alter the build system, it just makes your IDE more helpful.

Assuming it's a valid IDF component, you would need to specify "/home/mzimmers/wiced/sdk/WICED-SDK-2.4.1/Wiced/WWD" as a component directory by adding this to your project's root CMakeLists.txt:

Code: Select all

set(EXTRA_COMPONENT_DIRS 
    "/home/mzimmers/wiced/sdk/WICED-SDK-2.4.1/Wiced/WWD"
)
You will probably make life easier for yourself in the long term by keeping a copy of this in your project's components directory instead though (eg. as a git submodule).

User avatar
mzimmers
Posts: 643
Joined: Wed Mar 07, 2018 11:54 pm
Location: USA

Re: addition to c_cpp_properties.json includePath not working

Postby mzimmers » Tue Sep 14, 2021 3:37 pm

Hi boarchuz - thanks for the clarification; I didn't fully understand the intent of c_cpp_properties.json.

I don't intend to actually use any of the Wiced code; this project is a porting exercise to the ESP32 and the ESP-IDF. I just wanted to temporarily use their header files in order to get the program to build; all the calls into the Wiced libraries have been excised from the code.

Who is online

Users browsing this forum: grantb and 32 guests