Can you create a simple test-project where the problem occurs ?
I created a test project, where main.cpp includes test.h and test.h includes test_2.h.
test_2.h is not part of my project, but test.h is.
Inside test_2.h I have a function printing on stdout.
If I now change test_2.h the appropriate part of the program gets recompiled and the output is as expected.