Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   C/C++ (http://www.chiefdelphi.com/forums/forumdisplay.php?f=183)
-   -   Robot(): is private error being thrown (http://www.chiefdelphi.com/forums/showthread.php?t=152731)

Robodragons4630 18-12-2016 20:20

Robot(): is private error being thrown
 
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

Re: Robot(): is private error being thrown
 
First, make sure you understand visibility. Here's a stackoverflow question I found: http://stackoverflow.com/questions/8...ed-inheritance
You simply need to make the constructor public
Code:

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

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


Robodragons4630 18-12-2016 21:29

Re: Robot(): is private error being thrown
 
Quote:

Originally Posted by euhlmann (Post 1622167)
First, make sure you understand visibility. Here's a stackoverflow question I found: http://stackoverflow.com/questions/8...ed-inheritance
You simply need to make the constructor public
Code:

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

Re: Robot(): is private error being thrown
 
Quote:

Originally Posted by Robodragons4630 (Post 1622170)
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.


All times are GMT -5. The time now is 09:58.

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