libvips/lua-vips

cannot load module 'libvips-42.dll' on Windows

Closed this issue · 7 comments

gVimer commented

image
image
add the bin area of the libvips Windows build to PATH.Can you help me?

Hi,

I think you can use os.setenv("PATH", ...) in your code before starting FFI. Though I've not tested it.

gVimer commented

Thank you for your replay but there is no the method in os module
image
image
I can use the VIPs command,This can indicate that I have set the environment variables correctly.
image

gVimer commented

It still reported an error when using an absolute path to load
image

Then it'll probably be one of the classic Windows linking issues. Either you're trying to mix 32- and 64-bit code, or you have a DLL clash on your path.

Look at your path carefully and make sure you only have one version of each DLL on the PATH variable.

gVimer commented

Thank you for your help and I Successfully solved this problem.
Just let the Vips dll to be the first search path.
image

Unfortunately this has probably broken some other software you have installed :(

The libvips BIN area includes a lot of common DLLs, such as libjpeg. If you have another package installed which also includes libjpeg.dll, and that older libjpeg.dll is not binary compatible with the one that libvips ships, that other package will no longer work.

It's safest not to change PATH, and instead set PATH in your program during startup.

Perhaps with https://stackoverflow.com/questions/41367667/set-shell-environment-variable-in-a-lua-5-3-script ?

gVimer commented

Ok,Thank you for your suggestion. I will try it out.