Getting an error in the vex.h file for the Vex VSCODE extention

Alright, so when I import my project into visual studio through the vex extension. I’m getting an error in the vex.h file. I have 4 errors in my problems tab I will put below that nobody in robotics knows how to fix. I also cant find any other posts about it so that’s why I’m creating one. Some help would be greatly appreciated as we have our first competition this Saturday and we only have 2 more days to fix this.

Errors:

  1. #include errors detected. Please update your includePath. Squiggles are disabled for this translation unit (C:\Users\parker.rasys\Documents\vexcode-projects\OverUnder\src\main.cpp).

  2. cannot open source file “string.h”. Please run the ‘Select IntelliSense Configuration…’ command to locate your system headers.

  3. cannot open source file “v5.h”

  4. cannot open source file “v5_vcs.h”

Current code for vex.h:

#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include “v5.h”
#include “v5_vcs.h”

#include “robot-config.h”

#define waitUntil(condition)
do {
wait(5, msec);
} while (!(condition))

#define repeat(iterations)
for (int iterator = 0; iterator < iterations; iterator++)

make sure you have the c/c++ extension for vs code installed. If you do not have it installed, you can install it with ext install ms-vscode.cpptools in the command palette. check that the vexcode generated a file ./.vscode/c_cpp_properties.json if it didn’t, I would try creating a new project with the vexcode extension. let me know if this helps, or if you get more errors

Thanks, I’ll try this after school today. I think i might have the extension installed but i will make sure it’s the right one. I have tried restarting the project and computer but that didn’t help. Thanks again for responding and I’ll let you know what happens.

So i got this error in the console while trying to build and download the project onto the brain.

Log
windows build for platform vexv5
“CXX src/main.cpp”
In file included from src/main.cpp:24:
include\vex.h:10:10: fatal error: ‘math.h’ file not found
#include <math.h>
^~~~~~~~
1 error generated.

make: *** [vex/mkrules.mk:13: build/src/main.o] Error 1

Download Failed: Make process closed with exit code: 2

hey, im at school right now, but i had that exact same error and managed to solve it. i can help you tonight, dont lose hope :smiley:

@ParkerRasys can you change verbosity option at the top of the make file and send the new output

put the built in include files at the top of main.cpp instead of vex.h. I’d tend to leave vex.h alone unless you’re adding custom headers, in which case you’d put them in vex.h.

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