Congratulations to our 2022 Qt Champions!

Include problem

  • Hello,

    I have a problem by including classes. I try to include a class calls cfgreader in another class calls errhandler. Now the problem, the class errhandler requires as include the class cfgreader. For better understanding:

    @#include "errhandler.h"@

    @#include "cfgreader.h"@

    I don't know how I can search this on the Internet, so maybe someone can help me or can give me a clue?

    Thank you!

    Best regards,

  • Lifetime Qt Champion


    That's called circular dependencies

  • I would add your problem is circular dependencies,
    your solution is forward declaration.

Log in to reply