Link to home
Start Free TrialLog in
Avatar of stephenblade
stephenblade

asked on

Super easy question!!!

Just wondering do visual C++ programs have to carry around those huge runtime files like VB????

NoelH
ASKER CERTIFIED SOLUTION
Avatar of chensu
chensu
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of noelh
noelh

So for an extra 30 points what in very basic laymens terms is the difference between static and dynamic linking?


StephenB

linking statically means that the object code required from libraries (such as the windows libraries) gets copied into the excutable file when the application is linked - so the library code increases the size of the executable file.

linking dynamically means that the object code required for libraries stays in library files (DLLs are dynamic link libraries) and is loaded by the operating system as required at run time.

There are advantages and disadvantages to both approaches.
I'm not sure that I agree with chensu.  It may depend on what exactly you call large, but when VC program is dynamically linked to the runtime library (RTL), it requires the MSVCP60.DLL  (401,462 bytes) and the MSVCRT.DLL  (254,005 bytes) or more than 600K of DLL space.  Now if you statically link to the RTL, it will not take up as much space, because there are likely to be portions of the RTL that you are not using and that cn be stripped from the final executable.
>It may depend on what exactly you call large

Yes, stephenblade is comparing with VB run-time library. VB code should be larger than equivalent C++ code.