Using includes with c++ shared libraries

If anything in math.h or time.h shows up in your library routines’ interface, then the includes must be in your library’s .h since they must be visible to the code that calls your library routines. Othewise it’s quite acceptable (to the compiler, at least,) to hide them away inside the library’s .cpp file.

Leave a Comment