Hello!
I’m programming in C++ with the Vex Robotics extension on Visual Studio Code. Every single time I make a new project - the “math.h” file is erroring out. I have tried deleting VS code and the Vex Robotics extension completely and nothing helps. Does anyone have any ideas? The error is simply ‘math.h’ file not found - even though it clearly is when I go to my files.
Do you mean that a new project will not build and download to the V5 brain ? or do you just mean that intellisense is showing an error ?
When I download everything fresh - and create a brand new project - the math.h file is erroring out. That is because it has multiple include file errors within it. So I can’t even build or upload because math.h include within the vex.h include is erroring out.
I will send screenshots later when I can.
Try downloading the microsoft C/C++ extension and seeing if that fixes your problem.
OP said they could not build, it should still build if C/C++ extension is not installed.
While this is true, the OP has not yet provided any screenshots allowing us to identify this as a linter or build issue. Based on previous experience, many new users often confuse the two so I do not assume anything even if they use the word “build”. From the description math.h include within the vex.h include is erroring out
, it sounds like they noticed a red squiggle under #include "vex.h"
, went to that file, and then found another red squiggle under #include "math.h"
. If this is what OP did, downloading the C/C++ extension will likely fix their problem.
yea, I know it’s most likely just a linter error, but they did say they could not build or upload.
Here is the error. Yes, I do have the C/C++ extension installed - so that cannot be the problem.
Do you have anything else such as clangd installed ?
I have that extension installed. Uninstalling it fixed the “math.h” error - but now when I try to build my project I get this…
Highly unlikely this is the issue, but your next include line appears to be wrong: should be stdio.h
but you have stuio.h
.
It’s been a long time since I’ve actually seen it as a problem, but there was a time that IntelliSense’a database would get completely whacked for a program, and show linter errors where there were none.
Going back to one of James’ original questions that I didn’t see answered, what is the output when you actually hit the “Build” button. Is it actually throwing an error on math.h
? Screenshot or copy/paste of that log output would be helpful.
On line 2, you wrote #include <stuio.h>
. Did you mean to type #include <stdio.h>?