Creating both static and shared C++ libraries
I'd like to build both static and shared libraries in a project. I know that shared libraries need to be be created from objects compiled with -fpic to get Position Independent Code while the static library doesn't need this. This is all fine and I can create either a shared or static library. I wouldn't want to compile my source twice to get the different object files, so how is this usually done? I read how to get a shared library based on a static one . However, the example shows the static library being built with -fpic. Is this the way to go? Are there things to be aware of with this? Is