When I create shared libraries, I have a header file (but without a file name extension) in the root directory of the library source, just like the library.
So, for example, if my library was called libirock.so, then I would have a file called irock in the root of the project. This file will contain all the most important headers in the library, so when the library is implemented, all you have to do is use this include line:
#include <irock> // Instead of <irock.h>
I had an idea when I saw a compiler warning like this:
#include <string.h> is obsolete, use #include <string> instead
Two questions:
- Uses irock instead of irock.h best practice?
- Is it right to use one header file instead of many headers?
Course of action
Thank you for your responses! From the answers I decided:
- Will use
<irock.h> instead of <irock> . - I will continue to use the header file 'primary'.
source share