51509670
1, that is, the main program (compiled as an EXE file) is compiled on the X86 platform, and it depends on a project (or Dynamic Link Library) if it is compiled by the x64 platform, the system prompts "file or assembly cannot be loaded... Or one of its dependencies. Attempts to load programs with incorrect format ." Errors. This is because 32-bit programs cannot load 64-bit DLL, and cannot call classes, methods, and objects. If the main program is compiled by the x64 platform, but the DLL is x86? Answer .. No!
2. Although the "program" compiled by any CPU depends on the operating system, the "DLL" compiled by any CPU depends on the main program that is called, that is, if the main program is 32-bit, the DLL is also 32-bit. If the main program is 64-bit, the DLL is 64-bit. Therefore, the DLL is generally compiled on any CPU platform, while the main program is usually compiled on X86 platform.
Conclusion: After learning about their differences, we know how to choose between them when packaging programs. Generally, the main program is compiled on the X86 platform and the DLL is compiled on the any CPU platform without knowing what type of operating system the customer's computer is or when both are used. If you know it is a 64-bit operating system, you can compile it on the x64 platform.
Differences between x86, x64, and any CPUs