I started a new code using c++, and I keep getting the error ‘Invalid arguments’ on the line:
START_ROBOT_CLASS(Robot);
Has someone experienced the same problem? Thanks.
I started a new code using c++, and I keep getting the error ‘Invalid arguments’ on the line:
START_ROBOT_CLASS(Robot);
Has someone experienced the same problem? Thanks.
Is that error being shown by the Eclipse indexer, the build console, or both? Did you start from an example project, and if so, which was it?
Did you do the step “Rebuilding the index”?
http://wpilib.screenstepslive.com/s/4485/m/13810/l/145319-creating-your-benchtop-test-program
We are having the same problem - and rebuilding the index doesn’t fix it. Any other suggestions?
I’ve found the indexer to not be the ultimate authority on whether one’s C++ code compiles. Try building the project and seeing if that error prints in the build console as well. If it doesn’t and the build succeeded, you can ignore the indexer.
The error is in the “Problems tab” on eclipse, and prevents the thing from building. I’ve tried rebuilding, and the problem occurs on every type of robot program (sample, iterative, example robot program).
Normally the START_ROBOT_CLASS(Robot) statement should sit outside the main class normally in Robot.cpp. It should be located outside of any defined method:
#include "WPILib.h"
#include "Robot.h"
OI * Robot::oi = NULL;
DriveBase * Robot::drivebase = NULL;
void Robot::RobotInit(){
oi = new OI();
drivebase = new DriveBase();
}
START_ROBOT_CLASS(Robot);
It would be great if you post your code that you are having a problem with.
See ya in the bitstream
I have screenshotted the thing but this forum doesn’t let me post the image.
The code is below:
#include "WPILib.h"
class Robot: public IterativeRobot
{
private:
void RobotInit()
{
}
void AutonomousInit()
{
}
void AutonomousPeriodic()
{
}
void TeleopInit()
{
}
void TeleopPeriodic()
{
}
void TestPeriodic()
{
}
};
START_ROBOT_CLASS(Robot);
The error is: Invalid arguments’, line 38, which is the START_ROBOT_CLASS(Robot); line.