Initialization in C++ is a little tricky when you're using objects as member variables.
When you declare the
limitSwitch(UINT32) constructor, the compiler is trying to use the
default constructor to create the
di object,
before it even looks at your constructor body. The
DigitalInput class doesn't have a default (or zero-argument) constructor, so the compiler is giving you a list of the constructors which
are available. You can tell the compiler to use another constructor by using an "initialization list."
I think what you mean to do is this:
Code:
#include "WPILib.h"
class limitSwitch
{
DigitalInput di; // robot drive system
public:
limitSwitch(UINT32 p) : di (p) { }
};
Hope this helps! Here are some links for more information: