我写了一个包,在编译时遇到了“没有命名类型”的问题。
这是代码:skeleton.h
#include "gp.h"
...
class Formula : public GP
{
...
};
...
class FormulaPopulation : public GPPopulation
{
...
Formula* NthMyGP (int n) { return (Formula*) GPContainer::Nth (n); }
...
};
当我编译时,编译器会指出 Formula(in FormulaPopulation) 没有命名类型,但是类 Formula 是在类 FormulaPopulation 之上定义的,我不知道为什么会发生这个错误......
如果您想了解更多信息,可以在此处下载软件包。(下载后解压这个文件,在“printNatural”目录下make,可以看到错误)
任何帮助,将不胜感激。