So let's say I have two statically built libraries. libFoo.a and libBar.a.
libFoo.a uses functions from libBar.a and libBar.a also happens to use functions from libFoo.a.
Now, let's create a program baz.cpp that uses libFoo and libBar. Normally, you'd type:
g++ baz.cpp -lfoo -lbar
However, because these two static libraries use each other...well there's no obvious solution to me as to how to get the compile-time linker to accept such a situation and link them all together.
Is this even a sensible and allowed thing by C++ standards? And if so, is there a non-hacky way to handle this?
Or would the preferred method be to compile all the object files from libBar and libFoo together into a single static library?