Page 1 of 1

(solved) addition to c_cpp_properties.json includePath not working

Posted: Mon Sep 13, 2021 5:22 pm
by mzimmers
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...

Re: addition to c_cpp_properties.json includePath not working

Posted: Tue Sep 14, 2021 6:05 am
by boarchuz
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).

Re: addition to c_cpp_properties.json includePath not working

Posted: Tue Sep 14, 2021 3:37 pm
by mzimmers
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.