Merging header files for a library

I was wondering, when you create your own static library, is it a good idea to combine all the header files into one wrapper header file? For example, let's say I have a bunch of * .h and * .cpp files that I have compiled into * .lib files. It is good practice to create a wrapper header file, so when I write include, I only need to include one header, which will include everything else I may or may not need. Does this bloat the * .exe file that would be linked to the library file with stuff that was not being used?


source to share

1 answer

If it is a static library, it will still become part of the exe if you make it one header or multiple headers. However, from a design point of view, it is better to keep the headers separate so that the user of this library only includes the headers that he needs most.



All Articles