Converting .so file of linux to a .dll file of windows
12,136
No. You will need to recompile the library for Windows.
Author by
Ashish kulkarni
Updated on July 20, 2022Comments
-
Ashish kulkarni almost 2 years
I have some C code (having various header files and a make file) compiled as a
.so
file in Linux(Ubuntu) and apython
program which calls the functions of this shared object usingCtypes
. Now, I want to use this program on windows. In windows,Ctypes
needs a.dll
file instead of.so
in linux.So, is there a way in which I can convert the
.so
files of linux into.dll
files to be used withCtypes
in Windows ? -
Eryk Sun almost 9 yearsThe section on Linking Against DLLs has nothing to do with the OP's requirements. He has an .so file, which is completely useless with Windows Python, and thus he absolutely must follow your first recommendation to recompile and relink as a Windows DLL. He's not trying to generate a Cygwin or MinGW compatible import library from an existing DLL.
-
uraimo almost 9 yearsCorrect, i just scrolled through the text, my bad, reference removed.
-
Ashish kulkarni almost 9 years@uraimo: Thanks. I will try the dlltool. Alternatively I was trying installing mingw on linux and compiling the code into a dll to be used on windows. Will that work ?
-
uraimo almost 9 yearsYes, you should be able to do that ("crosscompiling", alternatively use mingw on windows).
-
Admin over 8 yearsI've removed the reference to dlltool entirely, as it's not an alternative to recompilation.
-
Roni Hoffman over 8 yearsSorry, little confused, how would I recompile a .so file on windows to get a .dll if I dont have the source code, just the .so?