Home  >  Q&A  >  body text

c++ - 'Population' has not been declared

我有两个类Population和Group,因为要写一个Group的成员函数

void initialize(Population<T> &p, const int id);

但我已经加载了Population的头文件,IDE却提示我Population' has not been declared,请问这是什么情况??

这是Population的内容和位置

黄舟黄舟2714 days ago581

reply all(2)I'll reply

  • 怪我咯

    怪我咯2017-04-17 15:04:24

    includeThe paths all start from the current path. The picture you showed is a bit unclear. But based on the image information, I wrote it down. You can try it.

    reply
    0
  • 怪我咯

    怪我咯2017-04-17 15:04:24

    The problem has been solved because the Group file is already included in Population.h. So declare the Population class above the Group class and you can use it. .

    reply
    0
  • Cancelreply