You have to deploy the EXE file and all
of the DLL files that your EXE file might depend on.
Tools like Dependencies
can help a lot to figure out the required DLLs:
It is possible to avoid the dependency on the Visual Studio runtime DLLs and the UCRT DLLs by linking your EXE file against the "static" runtime instead of the "shared" (DLL) one - at the cost of a bigger EXE file:
Furthermore, 64-Bit EXE file only
runs on 64-Bit Windows. 32-Bit EXE file runs on 32- and
Also note that programs compiled by recent versions of Visual Studio only
run on Windows Vista and later. There is no
more support for Windows XP at this point. Visual Studio 2017 was the last one that still could target Windows XP; and even Visual Studio 2017 required selecting the special "v141_xp" toolset.
Yet another thing to consider: If you compile your program with SSE, SSE2, AVX or AVX2 instructions enabled, then it will crash
when you try to run it on a CPU that does not
support the required instruction set!
A good way to test the deployment of your program is using a "fresh" (untouched) Windows in a VM.
You can grab VM images for testing here: