Visual Studio: how to create a project that would compile 2 exe files?

后端 未结 6 1898
无人共我
无人共我 2020-12-16 10:20

So I have main.cpp and main2.cpp with int main in each. I want to get 2 exes out of it. Is it possible and what would be instruction to create such project?

6条回答
  •  情书的邮戳
    2020-12-16 11:02

    You can create a solution with two project one for each output you want. Then head to Build menu and select Batch Build.. and select both projects. If you want both exe files to be in one place you can specify a custom Post-build action: For both project: view the project properties page and in Build events select Post-Build events, then in the Command line field enter the command that will copy the output to the location you want, something like: copy $(TargetPath) c:\yourlocation /Y Then after you build the solution the output files will be copied to that location.

提交回复
热议问题