当前位置:网站首页>VS2019 C语言如何同时运行多个项目,如何在一个项目中添加多个包含main函数的源文件并分别调试运行
VS2019 C语言如何同时运行多个项目,如何在一个项目中添加多个包含main函数的源文件并分别调试运行
2022-07-27 14:55:00 【虎刀蛇邪】
第一个问题:如何运行多个项目
1.为什么总是运行同一个项目?
2.VS2017怎么一次性运行多个项目?
先说第一个问题:不管新建多少个项目,按调试运行的时候总是运行那一个,这是为什么呢?
右键解决方案—>属性:
我们可以看到一个“单启动项目”,而已下面有一个项目,这个项目就是默认的调试项目,它就是你每次调试都运行的那个。在这里更改就可以改变每次运行的是哪个项目了。
还有另外一种方法:右键项目—>选择调试—>
启动新实例,就能在不改变默认运行项目的情况下,运行你想运行的项目。
我现在就是要一次性运行多个项目(在客户端/服务器通信的情况下经常要用到),怎么办呢?
其实上面我们也看到了,在解决方案的属性那一页,有一个“多个启动项目”,选中它,下面会出现你这个解决方案所有的项目,每个项目右边选择启动,在主界面点击启动的时候就能多个项目一起运行了。
第二个问题:源文件下面运行多个项目
在使用VS编辑器学习C、或者C++的时候,很多人都喜欢在一个项目中写多个小程序来调试运行,因为每次新建一个项目都显得比较繁琐。但一个项目中包含多个main函数,项目是无法运行的。
这里我在一个项目文件下建了2个C++文件,均含有main()函数:
如果需要运行源1.cpp文件,除了运行的那个 源1.cpp文件之外,把其他所有的cpp文件设置为不参与生成就可以了。
对于不需要参与运行的文件源.cpp,鼠标右键点击“属性”:
将“从生成中排除”选项设置为“是”。
边栏推荐
- [paper reading] single- and cross modality near duplicate image pairsdetection via spatial transformer compare
- MPC5744p时钟模块
- Flex弹性盒布局2
- 从零开始Blazor Server(1)--项目搭建
- Getting started with nvida CUDA dirverapi
- Get the array list of the previous n days and the previous and subsequent days of the current time, and cycle through each day
- C语言之程序环境和预处理
- JD Zhang Zheng: practice and exploration of content understanding in advertising scenes
- Share a scheme of "redis" to realize "chat round system" that can't be found on the Internet
- Ten thousand words analysis ribbon core components and operation principle
猜你喜欢

Mpc5744p clock module

C语言之数据的储存

UML图介绍

什么是jsp?

File operation in C language

Scala for loop (loop guard, loop step size, loop nesting, introducing variables, loop return value, loop interrupt breaks)

C语言之指针进阶

codis集群部署

MySQL - linked table query

The class declared by the scala object keyword directly calls methods and associated objects
随机推荐
Gurobi——GRBLinExpr
选 择 结 构
log4j.jar和slf4-log4下载链接
Segment tree beats~
C语言之指针初级
C语言之结构体及位段
ES6数组的方法及伪数组转数组方法
JD Zhang Zheng: practice and exploration of content understanding in advertising scenes
Apache
File operation in C language
牛客题目——链表的奇偶重排、输出二叉树的右视图、括号生成、字符流中第一个不重复的字符
Build a cloud native file system for media assets
Measured: the performance of cloud RDS MySQL is 1.6 times that of self built
Character stream read file
md 中超链接的解析问题:解析`this.$set()`,`$`前要加空格或转义符 `\`
什么是jsp?
2021 national vocational college skills competition (secondary vocational group) network security competition questions (9) ideas
Shardingsphere-proxy-5.0.0 distributed snowflake ID generation (III)
Storage of data in C language
牛客题目——判断是不是完全二叉树、平衡二叉树