VS Code: problem with include paths (C/C++ extension)

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

VS Code: problem with include paths (C/C++ extension)

Postby mzimmers » Wed Sep 15, 2021 6:11 pm

Hi all -

I am trying to get my project to find esp-idf files, and running into some problems:
include.PNG
include.PNG (82.64 KiB) Viewed 780 times
I don't recognize the syntax of these entries, but I suspect something is wrong with it. Can anyone help me correct these entries?

Thanks...

EDIT: I got rid of all but the first line, and the error went away. (I guess since I'm not running on Windows, and don't have ADF installed, those lines were causing the problem.)

Unfortunately, I still get the "file not found" errors in the editor. I'm thinking something must be wrong/missing from my configuration section.

Code: Select all

                   "/home/mzimmers/esp/esp-idf/components/**",
 //                   "${config:idf.espIdfPath}/components/**",
When I hard-code the path (like the first line above, it seems to work. When I try to use the symbol evaluator, it doesn't. Where is config:idf.espIdfPath defined?

Thanks...

ESP_bignacio
Posts: 133
Joined: Wed May 02, 2018 12:12 pm

Re: VS Code: problem with include paths (C/C++ extension)

Postby ESP_bignacio » Sat Sep 18, 2021 8:52 am

This ${config:df.espIdfPath} is basically using the esp-idf extension settings values, which as you can see are replaced by ${env:IDF_PATH}.

This doesn't work because you haven't configured the esp-idf extension using the setup wizard (Open command palette -> ESP-IDF: Configure ESP-IDF extension) by following this install tutorial, for example.

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

Re: VS Code: problem with include paths (C/C++ extension)

Postby mzimmers » Mon Sep 20, 2021 3:47 pm

Hi bignacio -

Thank you for the reply. I did run the setup wizard, choosing the "Use Existing Setup" option. Still doesn't find those variables.

User avatar
mbratch
Posts: 87
Joined: Fri Jun 11, 2021 1:51 pm

Re: VS Code: problem with include paths (C/C++ extension)

Postby mbratch » Tue Sep 21, 2021 10:43 am

Does it work if you replace:

Code: Select all

${config:idf.espIdfPath}/components/**
with

Code: Select all

${env:IDF_PATH}/components/**
?

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

Re: VS Code: problem with include paths (C/C++ extension)

Postby mzimmers » Wed Sep 22, 2021 1:09 am

It didn't work, but then I realized that I don't automatically run the export.sh script -- I have an alias which I manually invoke from the shell. But I start up VS Code from the favorites bar. So I think that explains that.

I'm still curious to know why the original syntax didn't work, though.

User avatar
mbratch
Posts: 87
Joined: Fri Jun 11, 2021 1:51 pm

Re: VS Code: problem with include paths (C/C++ extension)

Postby mbratch » Fri Sep 24, 2021 8:54 pm

Well, I have to confess... I think I started from scratch maybe four times setting up VS Code with ESP-IDF before it finally "just worked". Each time being even more extra careful each step of the way. I think there are at least two different procedures kicking around for how to set it up. There's one published by Espressif Systems on Youtube, and another on their github page for the VS Code plugin. Once I had it working, I did have to tweak the paths a bit to get the intellisense working right (even though it would compile).

Who is online

Users browsing this forum: No registered users and 6 guests