将 linux 的 .so 文件转换为 windows 的 .dll 文件

Converting .so file of linux to a .dll file of windows

我有一些 C 代码(有各种头文件和一个 make 文件)在 Linux(Ubuntu) 和一个 python 程序中编译为 .so 文件它使用 Ctypes 调用此共享对象的函数。现在,我想在 windows 上使用这个程序。在 windows 中,Ctypes 需要一个 .dll 文件,而不是 linux 中的 .so

那么,有没有一种方法可以将 linux 的 .so 文件转换为 .dll 文件,以便与 Windows 中的 Ctypes 一起使用] ?

没有。您将需要为 Windows.

重新编译库