[英]How do you execute different C++ files within the same solution in microsoft visual studio 2013?
So I am trying to set up a project, I chose a console application and made it empty, so I add multiple files that just print out some text. 因此,我试图建立一个项目,我选择了一个控制台应用程序并将其清空,因此我添加了多个仅打印一些文本的文件。 I then compile and execute one file and it runs fine, but when I go to run a different one it runs the one that I just ran. 然后,我编译并执行一个文件,它运行良好,但是当我运行另一个文件时,它将运行我刚运行的文件。 I really don't know how to fix this so if you guys could help me that would be great. 我真的不知道如何解决这个问题,所以如果你们能帮助我,那将是很棒的。
Each console application can only have one main
function that starts when the application is run. 每个控制台应用程序只能具有一个运行该应用程序时启动的main
功能。 However, you can have multiple console applications per Visual Studio solution. 但是,每个Visual Studio解决方案可以有多个控制台应用程序。 If you right-click on a console application in the Solution Explorer you can click Set as StartUp Project so that it starts when you "run" your solution. 如果在解决方案资源管理器中右键单击控制台应用程序,则可以单击“ 设为启动项目”,以便在“运行”解决方案时启动。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.