从孩子那里继承对图书馆的参考? [英] Inheriting Reference To Library From Child?

查看:43
本文介绍了从孩子那里继承对图书馆的参考?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨伙计:

  在Win 10 Pro,VS 2017社区,所有C ++,Win32没有MFC上开发。 

   Developing on Win 10 Pro, VS 2017 Community, all C++, Win32 no MFC. 

  这是我长期以来一直想知道的事情。 

   Here's something I've been wondering about for a long time. 

  我有一些大型项目,对我编写的库有很多依赖,还有一些来自供应商的库。 

   I have some large projects with lots of dependencies on libraries I've written, and a few libraries from vendors. 

  我总是需要通过在"文件 - 添加 - 现有项目"菜单中添加它们并使用解决方案资源管理器添加对它们的引用来告诉我的顶级应用程序在"解决方案"中引用的每个库。 

   I always need to tell my top level application about each library referenced throughout the "solution", by adding them in the File - Add - Existing Project menu and adding references to them with the Solution Explorer. 

  这些形成了一个层次结构,可以提供看似丢失的有价值和节省时间的信息。 

   These form a hierarchy which could provide valuable and time saving information that seems to be lost. 

  使用文件 - 添加 - 现有项目菜单和解决方案资源管理器中的引用向每个库讲述其依赖关系不会导致该信息被向上传递到引用该库的应用程序或库。 

   Telling each library about its dependencies with File - Add - Existing Project menu and references with the Solution Explorer doesn't result in that information being conveyed upward to the application or library that references that library. 

  如果我可以告诉我的应用程序或库直接引用它们的库,并让这些库向上传达它们自己的引用,这似乎很方便。 

   It seems like it would be convenient if I could tell my application or library about the libraries it reference directly, and let those libraries convey their own references upward. 

  我们依赖于C ++代码中的抽象。 有没有办法在构建应用程序时抽象引用依赖项?

   We depend on abstraction in our C++ code.  Is there a way to abstract reference dependencies when building applications?

     谢谢你
     拉里

      Thanks
      Larry

推荐答案

也许你可以通过在标题中包含#pragma语句来实现这一点。 当项目使用特定库的头时,#pragma会将该库作为链接器输入拉出。
Maybe you could accomplish this by including #pragma statements in the headers.  When a project uses a particular library's header the #pragma would pull that library in as a linker input.


这篇关于从孩子那里继承对图书馆的参考?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆