Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

32-bit VC++ redistributable on 64 bit OS?

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?

like image 807
martinnitram Avatar asked Sep 27 '10 11:09

martinnitram


4 Answers

It is enough to install the 32bit redistributable.

like image 168
Karel Petranek Avatar answered Sep 23 '22 04:09

Karel Petranek


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).

like image 27
bitoolean Avatar answered Sep 21 '22 04:09

bitoolean


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.

like image 25
MSalters Avatar answered Sep 23 '22 04:09

MSalters


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).

like image 30
Czarek Tomczak Avatar answered Sep 19 '22 04:09

Czarek Tomczak