Shaul
Shaul

Reputation: 469

Using VS2015 to compile C++ for Vista

A few days ago I have posed the question in the header in a Microsoft forum. I was given two options that IMHO are not very good:

  1. Install the VS2015 redistributables on the target machine.
  2. Compile statically so that the code will not call the VS2015 DLL files.

The first option increases dramatically the installation time of my application.

The second option increases dramatically the size of the binary files, increases the build time and inapplicable when compiling with flag /CLR.

It now seems that by moving my development to Visual Studio 2015 I have to drop support for Vista (actually, to Windows 7 too) or provide a poorer product than the one I had previously provided.

Note: I hopped that using Platform Toolset = v140_xp will solve the problem but apparently it won't.

Please enlighten me with a better solution.

Upvotes: 0

Views: 911

Answers (1)

David Heffernan
David Heffernan

Reputation: 613461

Things have changed somewhat with VS2015. This article explains what you need to do: http://blogs.msdn.com/b/vcblog/archive/2015/03/03/introducing-the-universal-crt.aspx

In short, the Universal CRT is a Windows component now. It is supplied with Windows 10, and via Windows update on earlier versions. Your options:

  1. Rely on the Windows update packages.
  2. Apply the runtime redistributable.
  3. Link statically, which is strongly discouraged.
  4. Deploy the binaries needed for app-local installation of the runtime.

This final option matches what you currently do. The article says:

App-local deployment of the Universal CRT is supported.  To obtain the binaries for app-local deployment, install the Windows Software Development Kit (SDK) for Windows 10.  The binaries will be installed to C:\Program Files (x86)\Windows Kits\10\Redist\ucrt.  You will need to copy all of the DLLs with your app (note that the set of DLLs are necessary is different on different versions of Windows, so you must include all of the DLLs in order for your program to run on all supported versions of Windows).

Upvotes: 2

Related Questions