I've recently worked on a project where i've seen multiple .cpp source files without any header #includes.
They have a .h files where everything is declared but they never #include it. So is it somehow possible through the ide, make or whatever
to create global includes without ever writing a #include?
The purpose of a header file is to make things visible to the user of a library.
The library itself may be made up of as many .cpp files as you wish. Every .cpp does not need a header.
A common idiom is also to have an “internal” header for declaring stuff the .cpp files need to know about each other but that the external user of the library does not need to know (and/or should not know).
> They have a .h files where everything is declared but they never #include it.
This is truly terrible programming practice (unless these are definitions of templates and the cpp file itself is included at the end of the header file). Amateurs may do this; assuming that this is production code, how on earth did such a component pass a code review?
In addition, the #include of the header file that defines its interface should be before any other other #include and before any other declarations. This will allow the compiler to verify that the header is self-sufficient (that it is compilable; that a user who includes the header file won't get the nasty surprise of compile-time errors.)