Sounds a bit like a trick question :-)

When you build your B lib, at build time you will have to link to A.
The application will have to link to both.