Description
I'm able to install lua-zlib using LuaRocks on my Windows system. However, when trying to load lua-zlib, using require("zlib")
, I get an OS error dialog for lua.exe, saying "entry point crc32_combine
could not be located in the dynamic link library zlib.dll".
Upon further inspection, I found out that Windows will not load the zlib.dll that is the dependency of (lua-)zlib.dll, because it thinks it's already loaded, and it will try to load the zlib entrypoints from the lua-zlib DLL. From MS docs: If a DLL with the same module name is already loaded in memory, the system uses the loaded DLL, no matter which directory it is in. The system does not search for the DLL.
There are two fixes for this, neither seems currently doable:
- rename lua-zlib's DLL to some other name (which also changes the "require string", as asked in Naming conflict #24)
- use static zlib
Can you advise what to do now? Thanks