problem with including header files

Hi guys

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.

Does anyone know what's wrong there?
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?
Ok, just post what exactly you have.
Thanks a lot. It seems that was the problem. I took the definition to a cpp file and the problem was solved!
Topic archived. No new replies allowed.