Bottom Line: sources and headers that are still changing go in /src
. Code that has crystallised should go in /lib
& /include
(actually you could keep all .lib
s and their .h
s in /lib
).
- Keep own sources and headers together, provided they are (a) specific to this project or (b) have not yet been factored out as a shared library.
- Once certain sources in the main project have been factored out as a (relatively stable) library, place the
.a
or .lib
into /lib
, and its public interface header into /include
.
- All third party libraries and their public interface headers also go into
/lib
& /include
.
As others note, it is often more compatible for tools / IDEs to access .h
/.c
from one folder. But from an organisational view it can be useful to separate changing local code from stable lib code.