Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Static or dynamic linking the CRT, MFC, ATL, etc

Tags:

Back in the 90s when I first started out with MFC I used to dynamically link my apps and shipped the relevant MFC DLLs. This caused me a few issues (DLL hell!) and I switched to statically linking instead - not just for MFC, but for the CRT and ATL. Other than larger EXE files, statically linking has never caused me any problems at all - so are there any downsides that other people have come across? Is there a good reason for revisiting dynamic linking again? My apps are mainly STL/Boost nowadays FWIW.

like image 787
Rob Avatar asked Oct 26 '08 19:10

Rob


1 Answers

Most of the answers I hear about this involve sharing your dll's with other programs, or having those dll's be updated without the need to patch your software.

Frankly I consider those to be downsides, not upsides. When a third party dll is updated, it can change enough to break your software. And these days, hard drive space isn't as precious as it once was, an extra 500k in your executable? Who cares?

  • Being 100% sure of the version of dll that your software is using is a good thing.
  • Being 100% sure that the client is not going to have a dependency headache is a good thing.

The upsides far outweigh the downsides in my opinion

like image 141
Kevin Laity Avatar answered Sep 25 '22 18:09

Kevin Laity