简体   繁体   中英

Create a 64 bit dll from a 32 bit C dll

I have a 32-bit dll that I have gotten from a third party. They have no 64 bit version. I wish to load this dll into 64 bit python. To do this, I need a 64 bit dll. Is there a tool to convert a 32 bit dll to a 64 bit dll or is this impossible? If it impossible then I must use 32 bit python I guess.

Only the vendor can do this, unless you get access to the DLL's source code. It must be recompiled for 64 bit.

I guess you'll have to use 32-bit python...

32 and 64bit DLLS have different ABIs and calling conventions . You just can't load a 32bit DLL into a 64bit process or the other way around.

As mentioned in the comments, you have to recompile from source.

You can't create a 64-bit DLL from 32-bit one without the source code.

But you can create an adapter as a native 32-bit application that loads the 32-bit DLL and provides access to it's functions via some kind of inter-process communications (eg named pipes)

Of course, that's may be senseless in some cases and you may prefer to use 32-bit python. So it depends.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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