首页 > 解决方案 > 在 C++ 中的继承类中创建构造函数后出错

问题描述

当我在 Rechteck 类中创建构造函数时遇到问题,错误见代码注释行*(没有用于调用'Form::Form()'| 的匹配函数)Form 类工作得很好。我正在使用代码::块。谢谢

  class Form
{
protected:
    std::string     name;    
    sf::Vector2f    bezugsp; 
    sf::Color       farbe;   
    sf::VertexArray punkte;  
public:

    Form(const std::string &n, const sf::Vector2f &bp=sf::Vector2f(0.,0.),
         const sf::Color fa=sf::Color::Black){}
    ~Form();                    

    std::string get_name() const{}       
    sf::VertexArray get_punkte() const{} 
    sf::Vector2f get_bezugsp() const{}   
    void set_bezugsp(const sf::Vector2f bp){} 
    void set_farbe(const sf::Color fa){}

    void gen_array(){}           
 };


class Rechteck : public Form
{
public:

    float hoehe=0;
    float breite=0;

    Rechteck(){    //AT THIS LINE ERROR************

    }

    virtual ~Rechteck(){}

    void dew(){}

protected:

private:
};

标签: c++inheritance

解决方案


推荐阅读