S
Sam Smith
Hi,
I'm thinking about whether or not to build a general library on its own and
later link that lib with the main executable, or to build the main
executable with a subset of the relevant source files from that library.
If I choose to build the executable directly with only relevant source
files, I know I do not bloat the executable with symbols and functions that
are never used.
But I do not like to manage this kind of dependency! I'd much rather just
build a lib with all files that belongs to that module and later link
against that library when producing the exe. Separations of concern and easy
management of dependicies
However, I'm not sure if this may lead to an undesired increase of the
executable's size (since unused symbols and functions may get linked in into
the executable). What is the story about this?
I know that this must be an implementation issue, i.e. it is up to the
linker to leave unused stuff out of the exe - but I hope that there is a
general answer
Thanks in advance!
I'm thinking about whether or not to build a general library on its own and
later link that lib with the main executable, or to build the main
executable with a subset of the relevant source files from that library.
If I choose to build the executable directly with only relevant source
files, I know I do not bloat the executable with symbols and functions that
are never used.
But I do not like to manage this kind of dependency! I'd much rather just
build a lib with all files that belongs to that module and later link
against that library when producing the exe. Separations of concern and easy
management of dependicies
However, I'm not sure if this may lead to an undesired increase of the
executable's size (since unused symbols and functions may get linked in into
the executable). What is the story about this?
I know that this must be an implementation issue, i.e. it is up to the
linker to leave unused stuff out of the exe - but I hope that there is a
general answer
Thanks in advance!