Search code examples
pythoncswig

Running a SWIG bound Python+C program gives a missing DLL error when running on another computer


So I have compiled a small testing program that uses SWIG as a bridge between python and C. The main part of the program is the python file. The thing runs fine on my own pc, but as soon as I transfer it to another, it immediately throws a "ImportError: DLL load failed: The specified module could not be found." error. I tried to see if it could be a file location that was statically coded by moving it to another directory on my own pc, which still worked fine. Next I did some debugging in the SWIG python wrapper, and found out what DLL it was loading; whose file path was correct too. My other PC also had the correct path. Does anyone know something that I might have forgotten that causes this error?


Solution

  • Everyone having this problem should probably check out the dependency walker, and see what DLLs are missing. It solved my problem.