32-bit VC++ redistributable on 64 bit OS?
Asked Answered
P

5

5

Using Visual Studio, I have built an C++ application running in 32bit. It will be deployed both to 32-bit and 64-bit Windows servers. It won't be run in 64-bit mode (but rather under WoW).

Should I include both the 32-bit and 64-bit Visual C++ redistributable, and install 32bit on 32bit Windows and 64bit on 64 bit Windows, or is it enough to just install the 32bit redistributable?

Pyx answered 27/9, 2010 at 11:55 Comment(0)
O
5

It is enough to install the 32bit redistributable.

Osteoclast answered 27/9, 2010 at 12:3 Comment(0)
F
3

EDIT: I commented below on a misleading answer, but the answer is you only need the 32-bit redistributables, as Karel Petranek answered first.

This is not an answer. It should only be a comment, but since I don't have the required reputation for that...:

I just wanted to warn people against Ruel's provided information. No, the 64-bit Visual C++ redistributable packages don't also include the 32-bit DLLs.

I have even tested that (his) theory. I tried to run an application that requires Visual C++ 2010 32-bit redistributables and it prompted me that it needs that. I then installed the 64-bit one, and it still prompted it needed the 32 bit version of Visual C++ 2010. After installing the 32 bit one, it worked.

Why people come up with theories and provide them as answers beats me. Or maybe he was also "encouraged" by the reputation system to give not only superfluous, but also false information. Or maybe he just confused C++ with DirectX 9 redistributables (that one does install both 32-bit and 64-bit DLLs).

Frankpledge answered 21/4, 2015 at 2:36 Comment(0)
S
1

Both are Microsoft products, but don't let that fool you.

Your C++ application creates a 32 bits EXE, linking to 32 bits DLLs. As it happens, one or two of those DLLs are Microsoft CRT DLLs, but the OS still uses the same rules. Therefore, you don't need the 64 bits DLLs.

Saldana answered 27/9, 2010 at 12:6 Comment(0)
P
1

Compile it using /MT option and VC++ runtime library will be compiled into your exe, so you don't have to worry about distributing it.

Project > Properties > Configuration Properties > C/C++ > Code Generation > Runtime Library > Multi-threaded (/MT).

Parsec answered 18/2, 2011 at 22:7 Comment(2)
This is not really a great idea, because any bug fixes (including security issues) in VC++ runtime by MS will not make into your product, as you would have a static exe. Embedding the runtime should be clearly weighed in terms of pros and cons.Stook
@Stook Besides, it will also take up more of the memory at run time, I think? When multiple processes that use the same runtime are running at the same time, they will take advantage of the system loading the shared library only once, right? If it's statically compiled, we are preventing the system from doing that. Also, more space on the drive would be occupied. An advantage of static compilation is more portability.Frankpledge
M
-2

The 64-bit Visual C++ redistributable package includes both 32-bit Visual C++ redistributable and 64-bit Visual C++ redistributable.

Maxine answered 27/9, 2010 at 12:10 Comment(2)
@Frankpledge states that this information isn't right, so 64 bit redistributable package might not include the 32 bit versions (I didn't test it myself).Verina
Indeed. I tested because when inspecting the contents of the installation package for the redistributables, it seemed they didn't include both versions of the libraries. See my answer. Please dismiss Ruel's answer until argument to the contrary.Frankpledge

© 2022 - 2024 — McMap. All rights reserved.