• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Dynamic or Static Libraries

 
Greenhorn
Posts: 9
Eclipse IDE Chrome Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is just a quick question which ive seen many discussions of before.
But the general answer is "dynamic libraries as if someone has a new version of the library it will use the newest version."
But most of the libraries I'm using like GLFW, GLEW and the MinGW libraries (libgcc and libstdc++) won't be on most computers.

So in that case, where that previous argument is invalid, which one is better and why?
 
Joshua Minter
Greenhorn
Posts: 9
Eclipse IDE Chrome Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Does anyone have anything to say?
 
Bartender
Posts: 1210
25
Android Python PHP C++ Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I assume this is targeted at Windows since you mention MinGW, .
Well, it's not mandatory in Windows that DLLs have to be installed in common system paths.
I'd use an installer software like NSIS and deploy them as DLLs in the same directory as the EXE.
One benefit is that if an update or patch has to be released that does not affect the dependencies, it can contain just the updated EXE and be a smaller download than a bloated statically linked version.
 
Saloon Keeper
Posts: 27763
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No point in "bumping" questions. We don't get paid so we answer when it's convenient. And if no one ever answers at all, it's either not been convenient or nobody knows. So just be patient.

Dynamic libraries have several benefits. They save disk space (no longer as big an issue as it used to be). They save RAM (still somewhat of an issue). And for complex functions, they can be upgraded to plug security exploits and fix bugs for a multitude of apps at the same time.

Windows originally had no idea of versioning on DLLs. There Could Be Only One. That led almost immediately to frustration with MFC.DLL and SOCKS. Ironically, at roughly the same time, the late, lamented Amiga OS understood the utility of having multiple versions of a shared libary and had included a version number as one of the criteria that an app would use for selecting one.

Linux/Unix also understand versioning, and use a 2-level (sometimes more) approach. You can open libtiff.so.5, or libtiff.so.5.2.2, depending on how necessary it is to reference a specific instance. Many times, less-specific library entries are actually links to more-specific ones, in fact.

If my fading memory doesn't fail me, Microsoft addressed this problem in .Net as well, but I haven't developed anything Windows-specific for a long time now.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic