Live data from Hacker News

Dynamic Linking Best Practices

begriffs.com

11–12 of 12 posts

Re: Dynamic Linking Best Practices

#11
Good coverage of dynamic linking, but for this part:

> To solve these problems, I suggest bundling all development (linking) library files together into a different directory structure per version.

Isn't it almost exactly what's called "framework" on macOS (author's proposed structure is different, but the idea looks the same)?

Re: Dynamic Linking Best Practices

#12
post #9

How this compares to Windows? IIRC it is all handled by the executable itself? The kernel32.dll is loaded at known address and it has LoadLibrary function to get a handle of DLL and GetProcAddress that resolves a function name to a function pointer. It loads DLLs from the working directory or system directories. No versioning. (But there are some compatibility tricks to provide correct version of the library even whe…

First of all it depends if it is a old style DLLs, or one that contains COM, as COM adds more execution models.

Additionally, applications can be packaged as DLLs and executed with help of rundll, after being loaded.

Manifests that control the loading process, besides the default way have been added in XP,

https://docs.microsoft.com/en-us/windows/win32/sbscs/applica...

Versioning in DLLs have been sorted out with SxS manifests, also in XP,

https://docs.microsoft.com/en-us/windows/win32/sbscs/isolate...

Previously versioning was sorted with VERSION resource scripts and expecting that developers actually cared about them, which most did not, hence the way .NET does versioning, and the latter improvements with manifest files for the dynamic linker.

https://docs.microsoft.com/en-us/windows/win32/menurc/using-...

Post reply on HN