IDEs can provide tools for this, but in the end it resolves to proper
usage of the compiler and linker.
For example, you can instruct the compiler to look for header files in
some folder (-I/some/folder) so that you don't need to specify the full
path in the #include statement.
Similarly, you can instruct the compiler where to put the object files,
and instruct the linker where to pick them, and where to generate the
executable.