Typically, we use project engineering created by Visual Studio to produce executable file names that match the name of the project, such as test with the project name, and the resulting file name is usually Test.exe. But sometimes we hope project the name of the executable file is not the same as the project name, or you want the resulting executable file to be saved under another path, you can do this by following these steps.
1. Under Visual Studio 2008
Select the menu bar "items"-"Properties"-"linker"-"general", as shown in the following illustration, the output file is set with the default road strength and project name, and you can see that the output executable is named after the project name, so we can modify the default project name with the name we want.
As shown in the following illustration, I replace "$ (ProjectName). exe" with "Math.exe"
After recompiling, you can see the resulting Math.exe executable under the same road strength, as shown in the following illustration:
If you also want to modify the path of the makefile, assuming that we want the generated executable to be in the C disk directory, you can modify the "C:" To replace "$ (OutDir)", as shown in the following figure:
After recompiling, you can see the generated Math.exe file in the C disk directory, as shown in the following illustration:
2. Under Visual Studio 2010
Under VS2010, you can modify output directory and target file name in configuration Properties-General. As shown in the following illustration, we modify the "Output directory" of the work project to "C:\" and modify the "target filename" to "myjob".
After recompiling, you can see the generated "Myjob.exe" file in the C disk directory, as shown in the following figure:
The VS2010 can also be set in the linker-general, as in the case of the VS2008 environment, without being described here.