Eclipse Problem

Hello, we are from FRC Team #6902 and we´re having a problem with our code.
We’ve installed all the plugins that First tells you to so you can code with eclipse, but for some reason eclipse doesn’t recognise terms from the wpilib. Whenever we try to send our code to the roboRio it suddently generates more errors. We’ve been attempting to download other plugins to fix it.
This is the code.

/----------------------------------------------------------------------------/
/* Copyright © 2017-2018 FIRST. All Rights Reserved. /
/
Open Source Software - may be modified and shared by FRC teams. The code /
/
must be accompanied by the FIRST BSD license file in the root directory of /
/
the project. */
/----------------------------------------------------------------------------/

#include <Drive/DifferentialDrive.h>
#include <IterativeRobot.h>
#include <Joystick.h>
#include <LiveWindow/LiveWindow.h>
#include <Spark.h>
#include <Timer.h>
#include <WPIlib.h>

class Robot : public frc::IterativeRobot {
frc::Spark M1{0};
frc::Spark M2{1};
frc::Spark M3{2};
frc::Spark M4{3};
frc:: DifferentialDrive Motor13 {M1,M3};
frc:: DifferentialDrive Motor24 {M2,M4};
frc::Joystick m_stick {0};

void TeleopInit() override {}

void TeleopPeriodic() override {
	Motor13.ArcadeDrive(-m_stick.GetY(), -m_stick.GetX());
	Motor24.ArcadeDrive(m_stick.GetY(), m_stick.GetX());
}

void TestPeriodic() override {}

};

START_ROBOT_CLASS(Robot)

FIRST has shifted from eclipse to VSCode, so it might be due to that. Personally I would recommend switching unless you have a specific workflow that requires Eclipse. Sorry I can’t help you answer your problem.

FRC Team 3647

Hi, and thanks for the tip!
But we tried using VScode and there is an error when including anything.
Apparently we should do something called includePath but after searching the matter we still dont know how to do so.

It seems like we should do something in c_cpp_properties.json:
{
“configurations”:
{
“name”: “Win32”,
“includePath”:
“${workspaceFolder}/**”
],
“defines”:
“_DEBUG”,
“UNICODE”,
“_UNICODE”
],
“windowsSdkVersion”: “10.0.17134.0”,
“compilerPath”: “C:/Program Files/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.15.26726/bin/Hostx86/x86/cl.exe”,
“cStandard”: “c11”,
“cppStandard”: “c++17”,
“intelliSenseMode”: “msvc-x64”,
“configurationProvider”: “vscode-wpilib”
}
],
“version”: 4
}

We`d be glad if you could help us here, VScode seems like a way better option than eclipse.
Thanks anyway.

We are having the same problem on our end. There is a way to transfer the Eclipse files over to VSCode, but we can’t seem to get it to work.

You explicitly don’t want a c_cpp_properties.json. The wpilib extension replaces it, and actually creating that file can cause the upstream C++ extension to do weird things.

If you’re getting errors when trying to include, follow these steps. Also make sure you have the right folder open in VS Code. If you update to the 2019.2.1 vscode extension, it will make sure of this second part.

For steps, run the WPILib C++: Refresh C++ Intellisense command, close all tabs in vscode, reopen vscode, wait 1 minute, then open your files.