2 ms·
> if you only use FooPackage.BarClass and FooPackage.bazMethod()... That's how it works already with static linking (just under the hood), the linker will disc
by flohofwoe 5y ago
> if you only use FooPackage.BarClass and FooPackage.bazMethod()...
That's how it works already with static linking (just under the hood), the linker will discard unused code and data (with LTO this happens automatically for all dead code and data, otherwise some special compiler/linker/librarian-options may be needed).
A DLL on the other hand cannot predict what API functions will actually be called on it, so everything must be included.