I wrote a package, and I confronted “does not name a type” problem while compilation.
Here’s the code:
skeleton.h
#include "gp.h"
...
class Formula : public GP
{
...
};
...
class FormulaPopulation : public GPPopulation
{
...
Formula* NthMyGP (int n) { return (Formula*) GPContainer::Nth (n); }
...
};
When I compiled, the compiler would indicate that Formula(in FormulaPopulation) does not name a type, but the class Formula is defined just above class FormulaPopulation, I have no idea why this error happens…
If you want more info, you can download the package here.
(After downloading, untar this file and make under the directory “printNatural”. you can see the error)
Any help would be appreciated.
Your tarball doesn’t build because files are missing, but there is a declaration of an
extern vector<myFNode> Formula;that would cause the conflict.It’s very confusing that it’s apparently possible to define the
Formulaclass without causing a conflict while it’s impossible to use it.