简体   繁体   中英

Is it possible to make a DLL that is both 32-bit and 64-bit?

I'm thinking like Apple did with their universal binaries containing both x86 and ppc code

No. The IMAGE_FILE_HEADER.Machine field determines whether a DLL is x86 or x64. One field cannot hold two different values simultaneously, and there's only one IMAGE_FILE_HEADER in a DLL.

That said, a pure.Net DLL contains IL instructions, and they can be compiled to either 32 bits or 64 bits.

You can build the dll as 32Bit and it can work in both 64 and 32 environment, but it will be 32 bit dll

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