I have three header files: OFunction.h which includes a function called fitness(), mWin.h and GSolver.h which contain a class each. I included OFunction.h in mWin.h and used it there. But there problem is when I include mWin.h in GSolver.h, I can't use the function there. I get the error that 'fitness' identifier not found.
You should not depend on headers including other headers. If you need a header somewhere, manually include it. Double inclusions are prevented with header guards anyways.
Thanks a lot. I tried that too, but the problem is still there.
But there is one thing I should mention. The OFunction.h includes the definition of the function as well, it means it has no .cpp file. Could that be the problem?