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.

Community
  • 1
  • 1
Matthias Bäßler
  • 480
  • 1
  • 5
  • 11
  • 4
    The redistributable packages are not installed to support your operating system, they are installed to support your application. – André Caron Jan 30 '12 at 16:53
  • ... and must be chosen to match your compiler. – Ben Voigt Jan 30 '12 at 16:58
  • @Ben: Of course, for Visual Studio 2008 I will deploy the 2008 redistributables AndréCaron: do you have a source for that? – Matthias Bäßler Jan 31 '12 at 06:59
  • @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. – Ben Voigt Jan 31 '12 at 14:44
  • @BenVoigt: sounds reasonable. Can you write this as an answer so I can accept it? – Matthias Bäßler Feb 01 '12 at 06:40

2 Answers2

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.

Ben Voigt
  • 277,958
  • 43
  • 419
  • 720
-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.

mdprotacio
  • 842
  • 6
  • 18
  • 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? – Matthias Bäßler Jan 31 '12 at 07:07
  • 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. – mdprotacio Jan 31 '12 at 12:57