Resolving circular dependencies by linking the same library twice?
The problem with g++ -o myApp -lfoo -lbar -lfoo is that there is no guarantee, that two passes over libfoo and one pass over libbar are enough. The approach with Wl,–start-group … -Wl,–end-group is better, because more robust. Consider the following scenario (all symbols are in different object-files): myApp needs symbol fooA defined in libfoo. …