I recently reinstalled the Windows 10 system. When I call the Lua script, an error occurs:
lua5.1: error loading module 'lfs' from file 'D:\BuildTools\lua-5.1.5_Win32_bin\lfs.dll':
The specified module could not be found.
stack traceback:
[C]: ?
[C]: in function 'require'
refresh-final.lua:3: in main chunk
[C]: ?
I checked the Lua installation directory and the lfs.dll file already exists. It shouldn't report an error. This is indeed confusing.
But based on my previous experience, I know that it is because other DLL files that this DLL file depends on were not installed correctly. This lfs.dll was compiled by me using VS2012, and after I reinstalled the system, the VS2012 runtime was gone. So I needed the Microsoft Visual C 2012 Redistributable. After I installed both the x86 and x64 versions, the script was able to execute correctly.
A problem similar to this is the issue of deploying gtk programs. Previously, I encountered an error using the gdk_pixbuf_save function. The prompt was
libpixbufloader-jpeg.dll: The specified module could not be found.
After I copied the libpixbufloader-jpeg.dll file to the corresponding program directory, this problem still existed. Later, I found that it depends on the jpeg62.dll file. When I copied jpeg62.dll to the program directory, the problem was resolved.