2019 C++ HELP setting up environment

Can not figure out what to fix to use this garbage IDE.

#include errors detected. Please update your includePath. IntelliSense features for this translation unit (/Users/Jim/Documents/Test Code/MechTest/src/main/cpp/Robot.cpp) will be provided by the Tag Parser.”

No instructions on including the WPI or CTRE libraries into the tool. Please help.

Which folder do you have open as the root folder in vscode? In your setup, you need the MechTest folder open, not the TestCode folder open. The build.gradle and gradlew.bat need to be showing up with all folders collapsed in vscode. Otherwise intellisense won’t work.

I don’t know what you mean by root folder open. TestCode is a parent folder to MechTest. If you mean in the explorer window of VSC, then yes, MechTest is the folder that is open.

My folder setup:
~/Documents/frc2019/{wpi lib .zip folder plus the ctre data added}
~/Documents/TestCode/MechTest/{project}

c_cpp_properties.json
{
“configurations”: [
{
“name”: “Mac”,
“includePath”: [
“${workspaceFolder}/",
"/Users/Jim/Documents/frc2019/maven/
” //**** added this trying to pull in the includes

        ],
        "defines": [],
        "macFrameworkPath": [
            "/System/Library/Frameworks",
            "/Library/Frameworks"
        ],
        "compilerPath": "/usr/bin/clang",
        "cStandard": "c11",
        "cppStandard": "c++17",
        "intelliSenseMode": "clang-x64",
        "configurationProvider": "vscode-wpilib"
    }
],
"version": 4

}

You explicitly don’t want the c_cpp_properties.json. it interferes. Also , you put the frc2019 folder in the wrong directory. It needs to be in ~/, not ~/Documents.

Once you move that, and delete the c_cpp_properties.json file, run through Refresh c++ intellisense command in vscode. That will extract all the headers properly.

When running refresh IntelliSense:

Executing task: ./gradlew generateVsCodeConfig -Dorg.gradle.java.home=“undefined” <

FAILURE: Build failed with an exception.

  • What went wrong:
    Value ‘undefined’ given for org.gradle.java.home Gradle property is invalid (Java home supplied is invalid)

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org
    The terminal process terminated with exit code: 1

I did " Set VS Code Java Home to FRC Home" But it gives an error. “Unable to write to Folder Settings because java.home does not support the folder resource scope.”

You are freaking brilliant. I LOVE YOU!!! Just had to restart VSC…

Yup. It searched for the jdk in ~/frc2019/jdk, but that doesn’t refresh until you restart vscode. Glad that works now.

We have some fixes for issues like that in the next release we’re doing, as especially for c++ you don’t need a jdk, just a jre that is at least java 8.

Now I’m trying to deploy to the robot. Our Dev bot is Team number 9990. I have confirmed I can ping it over wifi.

ping roboRIO-9990-FRC.local
PING roborio-9990-frc.local (10.99.90.53): 56 data bytes
64 bytes from 10.99.90.53: icmp_seq=0 ttl=64 time=1.242 ms
64 bytes from 10.99.90.53: icmp_seq=1 ttl=64 time=1.750 ms
64 bytes from 10.99.90.53: icmp_seq=2 ttl=64 time=1.764 ms

However I get this when i execute deploy:

Executing task: ./gradlew deploy -PteamNumber=9990 -Dorg.gradle.java.home=“/Users/Jim/frc2019/jdk” <

Task :discoverRoborio
Discovering Target roborio
admin @ roborio-9990-FRC.local: Connected.
Reason: InvalidImageException
RoboRIO Image invalid! RoboRIO: 2018_v17, allowed: [2019_v12]
3 other action(s) failed resolution.
2 other action(s) resolved but not connected.
1 other action(s) not started.
Run with --info for more details

Task :discoverRoborio FAILED

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ‘:discoverRoborio’.

A failure occurred while executing jaci.gradle.deploy.target.discovery.TargetDiscoveryWorker
Target roborio could not be found at any location! See above for more details.

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 3s
4 actionable tasks: 3 executed, 1 up-to-date
Missing Target!

Are you connected to the robot, and is it on?

GradleRIO detected this build failed due to not being able to find “roborio”!
Scroll up in this error log for more information.
The terminal process terminated with exit code: 1

You need to reimage your roborio to the 2019 image. It still has the 2018 image on it.

1 Like