Visual Studio Many Projects in One Solution VS中多工程开发

 

在用VS开发项目的时候,我们可以将不同的模块拆分开来,分别建立单独的Project来开发调试,整个放到一个Solution中就行了。这样做的好处是结构清晰,每个功能模块可以单独调试,而不用编译整个Solution,尤其当项目很大的时候,能节省很多编译时间。而且各个项目之间相互独立,对于每个模块,我们可以选择生成静态库Static Library或是应用程序Application,便于维护。那么下面来看如何将一个大项目拆分为若干个子项目:

 

1. Add new project in same solution, and drag all related "*.cpp" and "*.h" files into new project

2. Go to Property -> C/C++ -> General -> Additional Include Directories, add the directory of new created projects in the main project. Also, if sub-projects reference other projects, add the directories in the sub-projects too.

3. If some functions are called in another project, the current project probably needs to be a static library. So go to Property -> General -> Configuration Type -> Static library (.lib). Add the exported "*.lib" file in another project, go to Property -> Linker -> Input -> Additional Dependencies.

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值