问题
Is the package type (x86 or x64) dependent on my application type or on the OS type it is installed on?
I.e., if I develop a 32-bit application do I need to
- deploy the x86 package only or
- deploy both packages and install x86 on 32-bit windows and x64 on 64-bit windows?
The answer to this question 32-bit VC++ redistributable on 64 bit OS? suggests that it's only the x86 package, so it would be dependent on my application but it doesn't give any explanation/links. The MS download sites are also not specific on this.
回答1:
When you compile, all use of the standard library creates references that must be resolved at link time. The linker bakes in the import library for the matching runtime DLL(s), which must be matched completely at load time. That means matching the compiler version, service pack, and bitness.
Also remember that a 32-bit process cannot load 64-bit DLLs. Because the 64-bit redist only contains 64-bit DLLs, it is of no help when loading a 32-bit executable.
回答2:
it depends on the application if you need to maximize the potential of 64-bit OS, you may deploy both for handling 64-bit and 32-bit processing. However, if your application did not exceed the limits of 32-bit, you may deploy the application on x86 only, anyway it should also work on 64-bit OS via 32-bit virtualization.
来源:https://stackoverflow.com/questions/9067525/which-vc-redistributable-package-to-choose-x86-or-x64