Visual Studio Many Projects in One Solution VS中多工程开发
2017-11-01 11:32
555 查看
在用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.
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.
相关文章推荐
- Visual Studio 2008开发新特性系列课程(8):VSTO in Visual Studio 2008
- Project was skipped when rebuild the solution in Visual studio
- 使用VS进行工作流开发系列博客1-"So You Want to Develop Custom Workflows in Visual Studio..." - The Blog Series
- Visual Studio 2008开发新特性系列课程(8):VSTO in Visual Studio 2008
- Visual Studio 2008开发新特性系列课程(8):VSTO in Visual Studio 2008
- Shortcut Collapse project or projects in the Solution Explorer Microsoft Visual Studio 2008
- This project fills the absence of stdint.h and inttypes.h in Microsoft Visual Studio
- VS2015 新建 ASP.NET Web应用程序, 此模板尝试加载程序集‘Microsoft.VisualStudio.Web.Project’, 解决方案
- Solution of Problems in Building sscli via Visual Studio 2008
- TFS 2008: Message that "solution not currently configured for integrated source control in Visual Studio"
- QT常见问题一:VS打开QT解决方案,Qt Visual StudioAdd-in插件报错误
- Conditional breakpoints in Visual Studio,VS中有条件的断点
- Qt Visual Studio Add-in: Creating Qt Translation Files for the Project
- Visual Studio Macro: Locate Item in Solution Explorer on Demand
- Enable WiX project in Visual Studio 2013
- How develop BigData Project in Visual Studio
- 英文版Microsoft Visual Studio 6.0中, 莫名其妙间,点击“Find in Files”引起的开发环的崩溃问题解析:
- Conditional project or library reference in Visual Studio
- 配置WP开发环境问题:Visual Studio setup cannot run in compatibility mode
- 一个自动把Visual Studio.NET的C#,VB.NET,VC++project工程转为NAnt Build的小程序(利用XSL)