#includes are not always found

robinvice
Posts: 6
Joined: Tue Jan 16, 2024 12:45 am

#includes are not always found

Postby robinvice » Tue Jan 16, 2024 1:25 am

I'm using vs code v 1.85.1 with Espressif IDF v 1.6.5 running under Windows 11. Also, there's MS C/C++ IntelliSense v 1.18.5 along with C/C++ Extension Pack.

I'm having ongoing problems with #includes. Every time I try running new code that I've received from a colleague, I run into these problems. Up until the latest version of his code, I was able to get the includes to show up and all would work, only after hours of trial and error while scouring the web for similar problems. I haven't been able to get his most recent code to work after hours of trying all the things I've done before.

He's running under Linux and uses a cli to build and flash fw, so he's unable to help me figure out this Windows problem.

Here's what's happening:

I copy his project directory to the root of my data drive.

I adjust his c_cpp_properties.json file to point to my local directories (see attachments).

I get squigglies under the #includes (see attachments).

I have created an environment variable in Windows named "IDF_PATH", which points to "C:\Users\rvice\esp\esp-idf\components"

I'm not sure if there's anything wrong with the setup or code, or if the problem is a bug. I see lots of references to #include problems online, but haven't found one that leads me to a solution.

Can someone recommend which direction I should take this?

Thanks,
robin
Attachments
Include Headers.png
Include Headers.png (7.98 KiB) Viewed 18169 times
c_cpp_properties.png
c_cpp_properties.png (166.84 KiB) Viewed 18169 times

mikemoy
Posts: 611
Joined: Fri Jan 12, 2018 9:10 pm

Re: #includes are not always found

Postby mikemoy » Tue Jan 16, 2024 12:43 pm

what has worked for me is when I create a new project I typically get a Triangle in the lower right of the IDE.
Untitled.jpg
Untitled.jpg (21.11 KiB) Viewed 16678 times
Click on this, then you will get a popup on top, select the first one, and that fixes the issue (for me anyways)
Untitled1.jpg
Untitled1.jpg (46.8 KiB) Viewed 16678 times

Who is online

Users browsing this forum: No registered users and 84 guests