Framework and references vs project dependencies

Function "framework and references" can reference assembly generated by another project in same or separate solution, or contained in another team project and third-part assembly.

 

Function "project dependencies" . makes it possible for you to determine which projects in the selected solution must be built first. Setting project dependencies stipulates the desired build order for projects. 


Project dependency isn't a property of the linker, but rather the build chain as a whole.  Say project A is a stand alone binary that compresses a file.  Project B executes this binary.  Project B wants to make sure it has the most up to date binary of Project A available, so the developer says B is dependent on A.  Say the developer is working on Project B fixing a bug in some file, and this file happens to be shared with Project A.  Now when the developer builds their Project B, they will also rebuild Project A, getting the updated (corrected) version of Project A.  In this manner, a dependency exists, but it is not a linker based dependency.


As described here (see "Solution Dependencies into Project to project reference section") , the intent was to take linker level dependency out of the solution and push it into the project.


So If project A need use project B, in project A, we need (1) #pragma comment(lib,"B.lib") or in project properties--->linker--->input--->additional dependencies--->add "B.lib" (2) properties--->Framework and references--->Add new reference---->select project B, then in project dependencies, B is checked for A, and the build order is also sorted automatically (B build before A). (3) If A need include some new header files, you need add new include directory in A properties--->C/C++--->Additional include directories if necessary.

转载于:https://www.cnblogs.com/chuwachen/archive/2012/04/09/3911064.html

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值