Is the visual studio release mode exe file standalone or not?

Viewed 769

I want to build a single standalone executable file for a windows console application built in Visual Studio 2019. By standalone, I mean that I want a single exe file that I can move to any location on any computer and it will still run without extra files surrounding it (no dependencies).

For the life of me, I can't find a clear answer anywhere.

Question 1: Is the visual studio "release" executable file standalone?
Question 2: How do I make a standalone exe file that will run anywhere, no matter what libraries my code depends on?
Question 3: Can this be done inside visual studio, or do I need other software to do it?

1 Answers

You could use Microsoft Visual Studio Installer to deploy a Visual C++ Application.

For third-party libraries, you could select static linking version. If there is no static link version and only dll, copy the corresponding dll together when publishing.

For the c++ runtime library, select the static compilation method: Properties->C/C++->Code Generation->Runtime Library->Multi-threaded (/MT).

Also, you could use depends.exe (a Microsoft small tool) to view the dll, and then package it together.

Related