简体   繁体   English

是否可以制作 32 位和 64 位的 DLL?

[英]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我在想 Apple 对包含 x86 和 ppc 代码的通用二进制文件所做的那样

No. The IMAGE_FILE_HEADER.Machine field determines whether a DLL is x86 or x64. No. IMAGE_FILE_HEADER.Machine字段确定 DLL 是 x86 还是 x64。 One field cannot hold two different values simultaneously, and there's only one IMAGE_FILE_HEADER in a DLL.一个字段不能同时保存两个不同的值,DLL 中只有一个IMAGE_FILE_HEADER

That said, a pure.Net DLL contains IL instructions, and they can be compiled to either 32 bits or 64 bits.也就是说,pure.Net DLL 包含 IL 指令,它们可以编译为 32 位或 64 位。

You can build the dll as 32Bit and it can work in both 64 and 32 environment, but it will be 32 bit dll您可以将 dll 构建为 32 位,它可以在 64 和 32 环境中工作,但它将是 32 位 dll

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

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