私はC++が初めてです。これが私の問題です。h ファイルでバス、ステッパーをプライベート インスタンスとして宣言します。
class Motor_control
{
public:
...
private:
IICBus bus ;
IICStepper stepper ;
IICStepper stepper_r ;
IICStepper stepper_l ;
};
そして、コンストラクターでそれらを開始します
Motor_control::Motor_control(){
IICBus bus ("/dev/i2c-2",0,"");
IICStepper stepper (bus,0x00, "Global addr");
IICStepper stepper_r (bus,0x6e, "Stepper Modul");
IICStepper stepper_l (bus,0x66, "Stepper Modul");
}
IICStepper は .cpp で宣言されています。
IICStepper::IICStepper(IICBus& bus, int addr, const string& name) : IICBase(bus,addr, name) { } in cpp
そして.hで:
class IICStepper : public IICBase { public: IICStepper(IICBus& bus, int addr, const std::string& name); virtual ~IICStepper(){}; ...}
それはcompalins
../src/Motor_control.h:15: error: no matching function for call to 'IICStepper::IICStepper()'
../src/Stepper.h:41: note: candidates are: IICStepper::IICStepper(IICBus&, int, const std::string&)
../src/Stepper.h:38: note: IICStepper::IICStepper(const IICStepper&)
../src/Motor_control.h:15: error: no matching function for call to 'IICBus::IICBus()'
../src/Bus.h:28: note: candidates are: IICBus::IICBus(const std::string&, int, const std::string&)
../src/Bus.h:17: note: IICBus::IICBus(const IICBus&)
../src/Motor_control.h:15: error: no matching function for call to 'IICStepper::IICStepper()'
../src/Stepper.h:41: note: candidates are: IICStepper::IICStepper(IICBus&, int, const std::string&)
../src/Stepper.h:38: note: IICStepper::IICStepper(const IICStepper&)
../src/Motor_control.h:15: error: no matching function for call to 'IICStepper::IICStepper()'
../src/Stepper.h:41: note: candidates are: IICStepper::IICStepper(IICBus&, int, const std::string&)
../src/Stepper.h:38: note: IICStepper::IICStepper(const IICStepper&)
../src/Motor_control.h:15: error: no matching function for call to 'IICStepper::IICStepper()'
../src/Stepper.h:41: note: candidates are: IICStepper::IICStepper(IICBus&, int, const std::string&)
../src/Stepper.h:38: note: IICStepper::IICStepper(const IICStepper&)