c++ - Static or dynamic linking the CRT, MFC, ATL, etc -


back in 90s when first started out mfc used dynamically link apps , shipped relevant mfc dlls. caused me few issues (dll hell!) , switched statically linking instead - not mfc, crt , atl. other larger exe files, statically linking has never caused me problems @ - there downsides other people have come across? there reason revisiting dynamic linking again? apps stl/boost nowadays fwiw.

there downsides:

  • bigger exe size (esp if ship multiple exe's)
  • problems using other dll's rely on or assume dynamic linking (eg: 3rd party dll's cannot static libraries)
  • different c-runtimes between dll's independent static linkage (no cross-module allocate/deallocate)
  • no automatic servicing of shared components (no ability have 3rd party module supplier update code fix issues without recompiling , updating application)

we static linking our windows apps, because allows xcopy deployment, not possible installing or relying on sxs dll's in way works, since process , mechanism not documented or remotable. if use local dll's in install directory kinda work, it's not supported. inability remote installation without going through msi on remote system primary reason why don't use dynamic linking, (as pointed out) there many other benefits static linking. there pros , cons each; helps enumerate them.


Comments

Popular posts from this blog

c++ - How do I get a multi line tooltip in MFC -

asp.net - In javascript how to find the height and width -

c# - DataTable to EnumerableRowCollection -