Since every time when we link against a static library we also need to include the header files, I am wondering if it is possible to archive into the static library, when creating it, those heads?
Say I have two object files foo1.o and foo2.o generated by
gcc foo1.c -I foo1.h -c -o foo1.o
gcc foo2.c -I foo2.h -c -o foo2.o
Gcc tutorials tell us we can generate libfoo.a using
ar libfoo.a foo1.o foo2.o
This must sound silly, but is it possible to put those header files inside libfoo.a when archiving? In this way, when linking against libfoo.a, people no more need to spend hours in order to find and include foo1.h and foo2.h, so there seems to be some benefits in doing so, right?
Thanks for your ideas.
#includeit, and it works. - Crowman/usr/include, or/usr/local/include, or a custom path thatC_INCLUDE_PATHreferences. - Crowman/home/zell/include/or whatever you want, put your headers in there, and setC_INCLUDE_PATHto point at it in one of your login scripts. You just need to use your tools correctly, instead of look for suboptimal solutions. It's no different from installing the library itself. - Crowman