This is the only thing that I know to work.

With real production code, one would probably have to use
wrapper headers containing the __attribute__((weak))
declarations, both when building ApplicationLib and the tests.