Header files aren't magical, it's just a convenient way to ensure that your .cpp file has access to all the declarations and definitions it needs. Therefore, include only those that you really need in each of your files (1) .
The above applies to placing #include statements in your files - just use the header files that you really need. Of course, the header files you include can #include use other header files.
Like any other well-established (i.e. actually used) DLL, your DLL should provide a set of header files for a public interface. Under normal circumstances, you should have all these public interface header files in order to create a program using this DLL. This does not mean that you #include them all; on the contrary, you should not. The compiler (actually the preprocessor) will #include what it needs.
Note that when the DLL itself was created, it might have involved a lot more header files, but they were private for implementation, not part of the public interface. You do not need them to create a program using the DLL, and in general you do not even have access to them.
So, when developing your own DLL, you should clearly distinguish between public and internal header files. Public header files should be accessible to clients, internal ones should not (unless the client should create the DLL itself). Of course, this means that the public header file can never #include use the internal one.
(1) Note that the inclusion of the header file is purely textual: when reading the source file, the preprocessor effectively copies the contents of the header file and inserts it instead of the #include statement, then parsing continues. You made this copy and paste yourself, the file will build and run in the same way. Of course, he will not pick up later changes to the header file, which is the main reason that header files are used in the first place.
Angew source share