Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Technical Discussion (http://www.chiefdelphi.com/forums/forumdisplay.php?f=22)
-   -   C++ Code Not working (http://www.chiefdelphi.com/forums/showthread.php?t=141249)

tig567899 09-01-2016 21:23

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.

calcmogul 09-01-2016 22:13

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?

RufflesRidge 10-01-2016 00:24

Re: C++ Code Not working
 
Quote:

Originally Posted by tig567899 (Post 1519512)
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.

Did you do the step "Rebuilding the index"?

http://wpilib.screenstepslive.com/s/...p-test-program

ETGH 10-01-2016 14:51

Re: C++ Code Not working
 
We are having the same problem - and rebuilding the index doesn't fix it. Any other suggestions?

calcmogul 10-01-2016 15:06

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.

tig567899 12-01-2016 11:40

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).

DamenStar 12-01-2016 14:50

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);

It would be great if you post your code that you are having a problem with.

See ya in the bitstream

tig567899 14-01-2016 09:38

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);

The error is: Invalid arguments', line 38, which is the START_ROBOT_CLASS(Robot); line.


All times are GMT -5. The time now is 05:01.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi