does not have class type C++

前端 未结 4 956
眼角桃花
眼角桃花 2021-02-02 13:28

This is one class from my program! When I\'m trying to compile the whole program, I get an error message like this:

main.cpp:174: error: \'((Scene*)this)

4条回答
  •  广开言路
    2021-02-02 14:11

    You've declared (but never defined) lake as a member function of Scene:

    class Scene
    {
        // ...
        Lake lake(int L);
    

    But then in plot, you try to use lake as if it were a variable:

    int plot()
    {
        lake.light_up();
    

提交回复
热议问题