I have written a program using c++ in Visual Studio 2022 that I would like to build and send to somebody else to run on their computer. How do I go about doing this?
I've scoured the internet and I've found two answers. One is to go to the "build" tab at the top and click "publish", but my Visual Studio does not have the publish option. The other answer is that when I build the project in Visual Studio, it should be building a .exe in the Debug/Release folder. But my Visual Studio builds a .exe.recipe file, and I don't know how to use that.
Thank you in advance for your help.
You are looking for the wrong output folder path.
.exe.recipe
file is in folder $(Project)/x64/DebugOrRelease
The default x64 exe output path is located in the x64 folder in the same directory as the sln file.
└───ConsoleApplication1(.sln)
├───ConsoleApplication1(.vcxproj)
│ └───x64
│ └───Release
│ └───.exe.recipe // wrong
└───x64
└───Release // right
You can click rebuild
and check the output commands from the output window in Visual Studio.
1>------ Build started: Project: ConsoleApplication1, Configuration: Release x64 ------
1>ConsoleApplication1.cpp
1>Generating code
.......
1>Finished generating code
1>ConsoleApplication1.vcxproj -> .....\ConsoleApplication1\x64\Release\ConsoleApplication1.exe
Note that you need to distribute the program built in release mode.