0

I created a C++ console application using the template in Visual Studio 2019.

#include <iostream>
int main()
{
    std::cout << "Hello World!\n";
}

When I copy the .exe to the server then

  1. debug x64 build gives error (VCRUNTIME140_1d.dll missing)
  2. release x64 build works

Server is: Windows Server 2012 R2 Standard, 64bit

Reading this question / answer says that debug DLLs are not allowed to be redistributed.

I need to debug on the server and I have paid for all licenses.

What do I need to install to get debug build running on server?, e.g. full Visual Studio, Windows SDK, vc_redist.x64.exe?

When I compare the installed programs on my development machine and on the server: Windows SDK is not installed on the server.

  • 3
    You need to copy vcruntime140_1d.dll to the machine, storing it in the same directory as the .exe. Get it from, say, C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Redist\MSVC\14.24.28127\debug_nonredist\x64\Microsoft.VC142.DebugCRT. Meant for remote debugging scenarios, do make it a practice of deploying only the release build. – Hans Passant May 27 '20 at 09:55
  • @heboji3316, please check if the answer help you handle your issue and let us know if it works or not. – Mr Qian May 28 '20 at 09:03

1 Answers1

0

What do I need to install to get x64 debug build of C++ hello world .exe running on Windows Server 2012 R2 Standard?

First, thanks to Hans for all the help.

You can try these steps:

Step

1) when you migrate the exe file into the new server, you should put VCRUNTIME140_1d.dll from C:\Program Files (x86)\Microsoft Visual Studio\2019\xxx(VS version)\VC\Redist\MSVC\14.xx.xxx\debug_nonredist\x64\Microsoft.VC142.DebugCRT together with exe file.

For example, copy VCRUNTIME140_1d.dll into Debug folder which exists the hello world.exe file and then migrate the whole Debug folder into the new server.

2) or just install vc_redist.x64.exe on your server.

More into you can refer to this link.

Mr Qian
  • 21,064
  • 1
  • 31
  • 41