|
|
|
| I've been programmed to love you. |
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
C++ Code Not working
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. |
|
#2
|
||||
|
||||
|
Re: C++ Code Not working
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?
|
|
#3
|
|||
|
|||
|
Re: C++ Code Not working
Quote:
http://wpilib.screenstepslive.com/s/...p-test-program |
|
#4
|
|||
|
|||
|
Re: C++ Code Not working
We are having the same problem - and rebuilding the index doesn't fix it. Any other suggestions?
|
|
#5
|
||||
|
||||
|
Re: C++ Code Not working
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.
|
|
#6
|
||||
|
||||
|
Re: C++ Code Not working
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).
|
|
#7
|
|||
|
|||
|
Re: C++ Code Not working
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:
Code:
#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);
See ya in the bitstream Last edited by DamenStar : 12-01-2016 at 17:07. |
|
#8
|
||||
|
||||
|
Re: C++ Code Not working
I have screenshotted the thing but this forum doesn't let me post the image.
The code is below: Code:
#include "WPILib.h"
class Robot: public IterativeRobot
{
private:
void RobotInit()
{
}
void AutonomousInit()
{
}
void AutonomousPeriodic()
{
}
void TeleopInit()
{
}
void TeleopPeriodic()
{
}
void TestPeriodic()
{
}
};
START_ROBOT_CLASS(Robot);
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|