Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Should I put all header files inside the include dir?

I've been trying to find the answer to this question using the search function, but only came accross questions about missing header files etc.

Background: in the past 10 years of coding C/C++ I've learned that it's important to think about the (external) interface of the code I write. It's generally a good idea to keep it small and simple, hiding implementation details as much as I can. As a result, typically a software package/library that I would develop would have an include directory that only contains the header files that I want to expose to the users of that package/library, while the rest of the headers that are only intended for internal use are located in the src directory.

Now I'm getting started with ROS and I see quite a few packages that seem to put .h files in include and .cpp files in src. Is there are specific reason to do this?