Which VC++ redistributable package to choose (x86 or x64)?
Asked Answered
D

2

11

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.

Delores answered 30/1, 2012 at 16:51 Comment(5)
The redistributable packages are not installed to support your operating system, they are installed to support your application.Method
... and must be chosen to match your compiler.Armlet
@Ben: Of course, for Visual Studio 2008 I will deploy the 2008 redistributables AndréCaron: do you have a source for that?Mcalpine
@MatthiasBäßler: Everything should match the compiler: The version, the service pack level, the bitness. The reason is that a 32-bit process cannot load 64-bit DLLs, and the 64-bit redist contains only 64-bit DLLs.Armlet
@BenVoigt: sounds reasonable. Can you write this as an answer so I can accept it?Mcalpine
A
7

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.

Armlet answered 1/2, 2012 at 14:46 Comment(0)
N
-1

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.

Nightcap answered 30/1, 2012 at 17:3 Comment(2)
I think that's wrong: to maximize the potential on a 64-bit OS I need to compile it as a 64-bit application. The question is: if I decide to compile a 32-bit application, will I need the x64 redistributable on a 64-bit OS?Mcalpine
not really. you may use 32-bit redistributable since the targetted application deployment is 32-bit, you'll only need machine instructions designed for 32-bit processors.Nightcap

© 2022 - 2024 — McMap. All rights reserved.