Log in

View Full Version : Robot(): is private error being thrown


Robodragons4630
18-12-2016, 20:20
My code is throwing the error "Description Resource Path Location Type
'Robot::Robot()' is private Robot.cpp /ittest/src line 24 C/C++ Problem" and i have absolutely no idea where to start in fixing it. Here's my code. http://pastebin.com/N7kJ7454

euhlmann
18-12-2016, 21:04
First, make sure you understand visibility. Here's a stackoverflow question I found: http://stackoverflow.com/questions/860339/difference-between-private-public-and-protected-inheritance
You simply need to make the constructor public

class Robot: public IterativeRobot
{
private:
// some stuff

public:
Robot() // etc
// ...
}

Robodragons4630
18-12-2016, 21:29
First, make sure you understand visibility. Here's a stackoverflow question I found: http://stackoverflow.com/questions/860339/difference-between-private-public-and-protected-inheritance
You simply need to make the constructor public

class Robot: public IterativeRobot
{
private:
// some stuff

public:
Robot() // etc
// ...
}

I just tried that but it's still throwing the error. I think it's a glitch with eclipse because no matter how much i move around the code it always appears on line 24.

AustinSchuh
18-12-2016, 22:27
I just tried that but it's still throwing the error. I think it's a glitch with eclipse because no matter how much i move around the code it always appears on line 24.

Try saving your code before re-building.