'"Failed to load dynlib/dll" error for libdmtx.dll when running an executable generated by auto-py-to-exe

I am using the library pylibdmtx to generate a data matrix in my python script. Since the library uses the dll libdmtx.dll, I added it to the "Additional Files" (--add-data) section of auto-py-to-exe.

When I run the executable on my computer where I wrote developed the python project, the executable works perfectly but when I transfer the executable to a different computer and try running it there, I get the Failed to load dynlib/dll error.

I checked the temp folder that the executable was creating and using and found libdmtx.dll to be present there. I am not sure why the executable works only on my computer but not the others. Am I missing adding any other dependencies for libdmtx.dll?

Image of the error when the executable is run



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source