Cant include Rev/CANSparkMax

When trying to include rev/CANSparkMax I get an error “rev/CANSparkMax: No such file or directory”. I have installed the vendor libraries as detailed at

You used the zip, but did you load the vendor dep into your project. Does a RevRobotics.json file exist in the vendordeps folder for your project?

Also, if you added the library later, a popup should have occured asking you to refresh C++ intellisense. If you didn’t do that, they wouldn’t show up. Heres the steps to force that to occur, and worth trying.

  1. Close all files in VS Code
  2. In the command palette, run the Refresh C++ Intellisense command.
  3. Wait 1 minute.
  4. Open your robot.cpp file (not a header) and things should show up properly.
  5. Should be good from here.

Also, your include line is #include "rev/CANSparkMax.h" right?

1 Like

Thanks, that worked.

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