I think you are guessing right as to the cause (linker reference optimization). The right answer (IMO) is to build the shared library directly from source of group 3. You can try forcing the linker to resolve a symbol (for instance taking the address of an external function or declaring reference variable for external class). This doesn't necessarily have to work, though. Once the linker sees that the symbol is not being referenced by something that the library itself is exporting, there's no reason that it cannot just drop it.