VS Code not finding include files in C++

VS Code does not seem to search the folders listed in “includePath” inside c_cpp_properties.json for a programming project. Example, RobotBuilder generates code with
#include <frc/Commands/Scheduler.h>
but building fails because this files (and many others) cannot be found. We found the specific folder containing frc/Commands/Scheduler.h and made sure that folder is part of includePath, but to no avail.
Any suggestions?

Are you seeing problems with intellisense, or with building?

I don’t know whether IntelliSense is involved, but I know we have had trouble building. Two problems are reported in the example I attempted just now. (Related problem: I am unable to find the c_cpp_properties.json file containing includePath for this project, and the lightbuld above the include-file error squiggle does not show IntelliSense or includePath as an option.)

#include errors detected. Please update your includePath. Squiggles are disabled for this translation unit
(C:\Users\Excelsiorian2\FRCProjects\RoboTest\src\main\cpp\Robot.cpp).
cannot open source file “optional” (dependency of “Robot.h”)

Update: Trying again later worked on that sample code. No idea why. Trying to build sample code from Rev Robotics for color sensor fails because it can’t find HAL.h . Since we can find other WPILib stuff, don’t know why we can’t find HAL.h

We’re having the same problem. Any solution?

My team was also having include errors in C++, and if they are stopping your code from building these are the steps we used to resolve them on everyone’s computers:
1: Right click build.gradle
2: Click on Manage Vendor Libraries
3: Click Install new Libraries (offline)
4: Hit the check box for any libraries displayed there, even if you already installed them at an earlier date, and click ok
5: If step 3 returns “no new dependencies available”, click on Check for Updates (offline) instead, and repeat step 4 in that menu
6: If step 5 returns “No updates available”, you may have a different issue than we had. Check your include syntax, or maybe change from <> on the sides to “” or vice versa to see if that’s the issue. I wish you luck!

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.