Frustrating problems with VSCode

So our team is trying to use VSCode for our programming this year, and the code side of it is going great, the VSCode side of it is not.
We are having trouble with VSCode consistently running our code properly. The header files sometimes refuse to be either found or opened, and we’ve scoured Chief Delphi to no avail. The log itself states that either the .H files that the main Header files rely on or the main Header files themselves either aren’t found or can’t be opened. We’ve tried using the WPI Refresh C++ intellisense and that hasn’t fixed the problem.

Log.txt (21.1 KB)

This is what running the program gives in the log, and here’s some pictures of what the errors are being stated as in the program itself.


We’ve tried to fix intillisense a few different ways, and occasionally it will work, but if it does it doesn’t stay fixed.

If anybody has any idea how to fix this or suggestions they would be much appreciated. :slight_smile:

The errors you are having in the log.txt have nothing to do with vscode, they’re all C++ compiler errors.

D:\Catalyst\Documents\VsWorkspace\Pls\2019 Robot\src\main\cpp\Robot.cpp:80:3: error: 'rev' has not been declared
   rev::SparkMax frmotor{4};

You need to #include a rev header file that defines this, e.g. SparkMax.h?

D:\Catalyst\Documents\VsWorkspace\Pls\2019 Robot\src\main\cpp\Robot.cpp:84:34: error: 'frc::PWMSpeedController::PWMSpeedController(int)' is protected within this context
   frc::PWMSpeedController elbow{7};

You can’t just simply use PWMSpeedController directly. What’s the actual type of motor controller? Is it a Spark or a Talon? In that case, use frc::Spark or frc::Talon.

In C++, you should always start at the top of the error log and work your way down; the rest of the errors seem to be mostly due to the fact the variables above are never defined due to the above errors.

1 Like

Alright, the good news is that everything is working now. :smile:
You were definitely right on all of that, so we’ve taken care of that and managed to get everything to cooperate.
Thank you so much, and if anything goes wrong in the next day or two on this issue I will be sure to give an update on this.