简体   繁体   English

运行SWIG绑定的Python + C程序在另一台计算机上运行时会出现DLL错误

[英]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. 所以我编译了一个小的测试程序,它使用SWIG作为python和C之间的桥梁。程序的主要部分是python文件。 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." 事情在我自己的电脑上运行良好,但是一旦我将它转移到另一个,它立即抛出“ImportError:DLL加载失败:找不到指定的模块。” 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; 接下来,我在SWIG python包装器中做了一些调试,找出了它加载的DLL; whose file path was correct too. 其文件路径也是正确的。 My other PC also had the correct path. 我的另一台PC也有正确的路径。 Does anyone know something that I might have forgotten that causes this error? 有谁知道我可能忘记了导致此错误的事情?

Everyone having this problem should probably check out the dependency walker , and see what DLLs are missing. 有这个问题的每个人都应该检查依赖性walker ,看看缺少什么DLL。 It solved my problem. 它解决了我的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM