简体   繁体   English

如何在Microsoft Visual Studio 2013的同一解决方案中执行不同的C ++文件?

[英]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.

相关问题 在Visual Studio 2015下使用Microsoft Visual C ++ 2013进行编译 - Compiling with Microsoft Visual C++ 2013 under Visual Studio 2015 使用Microsoft Visual Studio 2013的C ++ 11用户定义的文字 - C++ 11 User Defined Literals with Microsoft Visual Studio 2013 C ++ SDL纹理错误Microsoft Visual Studio 2013 - C++ SDL texture Error Microsoft Visual Studio 2013 如何在Microsoft Visual Studio 2013中将IDE从C#环境设置为C ++环境? - How to set the IDE from C# environment to C++ environment in Microsoft Visual Studio 2013? C ++:为什么在Eclipse Neon中运行相同的代码在Visual Studio 2013中产生不同的输出? - C++: Why does the same code run in Eclipse Neon produces different output in Visual Studio 2013? Visual Studio C++ 不能在同一解决方案或外部文件夹中包含其他目录 - Visual Studio C++ Can't include additional directory within same solution or outside folder 如何将Visual Studio for Windows中制作的C ++解决方案转移到Visual Studio for Mac? - How do I transfer my C++ solution made in Visual Studio for Windows to Visual Studio for Mac? 您如何打包要发布的 Visual Studio C++ 项目? - How do you pack a visual studio c++ project for release? 如何在Visual Studio中预览C ++代码 - How do you preview your c++ code in visual studio 如何在 Visual Studio 中添加 C++ 项目引用? - How do you add a C++ project reference in Visual Studio?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM