Quote:
Originally Posted by ehlochbr
I really appreciate both of your replies, but making the corrections you suggested has led me to another problem.
The first error says "uninitialized reference". How do I initialize it?
The second error gets me back to where I started. It says "error within this context".
This feels like one step forward then two steps back. Thanks for your help.
|
You need to initialize all non pointer members before the body (and especially references, they only have one life)
try this:
Code:
class RobotDemo : public SimpleRobot
{
RobotDrive myRobot; // robot drive system
Gamepad controller;
AxisCamera& camera;
public:
RobotDemo(void):
myRobot(10, 9, 2, 1),
controller(1),
camera(AxisCamera::GetInstance())
{
GetWatchdog().SetExpiration(0.1);
Also, "error within this context" is part of a larger error, open the build console and find the red lines to find the rest of the message. many messages are 2 or more parts.
Ex (bold is error in code)
file.cpp: In constructor `ZomBDashboardPacketSender::ZomBDashboardPacketSen der()':
file.cpp:301: error: uninitialized reference member `ZomBDashboardPacketSender::hp'
WPILib/Dashboard.h:58: error: `void Dashboard::operator=(const Dashboard&)' is private
file.cpp:302: error: within this context