Robert Fraser wrote:
Your explanation sounds likely, however it seems VS is discriminating on the per-symbol level...?

Let's say the C++ source file looks like:

----------------------------
int foo() { ... }
int bar() { ... }
----------------------------

it is compiled and put into a library. Your program references foo(). Pulling in the object module from the library that contains foo() also pulls in bar(), because bar() is in the same object module. If bar() references a bunch of other stuff, that gets pulled in, too.

VS may contain some scheme to split a source file into multiple object modules which prevents this.

Note that dmd will split a single source file into multiple object modules when you compile with -lib.

Reply via email to