However the myModule dll is installed to LIBRARY on linux and windows.
Shouldnât this also be installed to RUNTIME in windows since it is still a dll file?
A key thing that differentiates a MODULE from a SHARED library is that you cannot link to a MODULE library. A MODULE is intended to be loaded dynamically at run time. The only reason DLLs get put in bin is so that any other DLL or executable that links to it can find it at run time (assuming that DLL or executable is in the same directory). Since a MODULE cannot be linked to, it doesnât have that need, and lib is the more appropriate location for it.
Yes. dlopen and LoadLibrary need to be able to get to it at runtime.
Wait, what? lib is where linker inputs go, and you canât link with one of these. Putting it in lib seems exactly backwards?
I understand this call was made forever ago and is likely frozen forever but I just want to make sure I understand.
I no longer recall the details of my reasoning at the time of my comment. Looking at it with fresh eyes today, I assume it was based around the idea that bin is conceptually âexecutables you run directlyâ, and that putting .dll files in there is just a pragmatic thing because Windows. That may well be a wrong view of things, but thatâs my guess.
@BillyONeal Since youâve re-raised it now though, Iâd be interested if you can share details on contradictory conventions or standards that recommend putting libraries that cannot be linked to and only opened via dlopen() or equivalent somewhere other than lib.
That makes sense. In my brain âbinâ is âthings that go to the customersâ machineâ and âlibâ is âthings that stay on the devâs machineâ but .sos kinda break this idea since they serve both purposes. Dynamic linking does seem to be one of those things for which people get a mental model about how it works on the platform they started on and have little understanding about everyone else and thatâs certainly true in my case
I donât really have âstandardsâ to point to. Only that on Windows DLLs are ~always expected to be in the same place the .exe is because thatâs where executable import tables and LoadLibrary look: step 7 of Dynamic-link library search order - Win32 apps | Microsoft Learn
I see contradictory things about where .sos should go; my naĂŻve Windows brain wants them in bin because they get shipped to the user. But I usually see them in lib so I understand Iâm probably mistaken about that. (Note that lib is explicitly where dlopen searches: https://linux.die.net/man/3/dlopen âThe directories /lib and /usr/lib are searched (in that order).â)