address of header file always incorrect

I’m new to c++.

I’ve noticed that, every time I create a new c++ class, when the engine auto-compiles, there’s always a compilation error. For the past few days it has hunted me, but I finally understand what caused it: the address of the header file in the .cpp file of the class is never generated correctly. I always need to manually add [project-name]/ at the beginning of the header file address. Now, this is incredibly inconvenient and troublesome. It also requires me to compile twice every time which can get tedious.
Is this problem experienced by others too? Why does it even happen?