如何生成缺少的#include文件的列表 [英] How to generate a list of missing #include files

查看:81
本文介绍了如何生成缺少的#include文件的列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

背景:我正在处理一个大型c ++项目,该项目具有多个可执行文件和库输出,并带有一组有效的make文件(即,假设您拥有完整的代码库,则可以键入make,并且它将构建所有库和可执行文件.

Background: I am working on a large c++ project with multiple executable and library outputs with a set of working make files (i.e. assuming you had the entire code base, you could type make and it would build all libraries and executables).

我的问题是我必须部分编译该项目,并简单地链接已经为该项目的其他部分编译的库.我已经为项目的另一部分提供了lib文件,但没有提供使用这些库所需的所有头文件.

My problem is that I must partially compile the project, and simply link in libraries that have been already compiled for other parts of the project. I have been supplied with the lib files for the other part of the project, but not all of the header files necessary to use the libraries.

问题:如何生成一个文件列表,我需要这些文件才能成功完成编译,然后链接依赖于预编译的项目部分项目的一部分?仅通过运行make文件,我会得到 first 缺少依赖项的错误,但是如何生成 all 的列表?

Question: How do I go about generating a list of files that I will need to request in order to successfully finish compilation and then linking of parts of the project that have dependencies on the pre-compiled portion of the project? Just by running the make file, I get an error for the first missing dependency, but how can I generate a list of all?

我尝试过的事情/示例:触发make脚本以编译并链接moduleA. make搅拌一会儿,然后发出一个错误,它找不到moduleBCommon.h,该错误已包含在moduleAxyz.h中.无法找到它,因为它在磁盘上不存在...我没有得到该文件,必须请求它.

Things I have tried / Example: Fire off the make script to compile and link moduleA. The make churns for awhile, and then issues an error that it can't find moduleBCommon.h, which was included from moduleAxyz.h. It can't find it because it does not exist on disk... I have not been provided the file, and must request it.

推荐答案

如果您没有moduleBCommon.h,那么您将不知道#include还有哪些其他标头,所以我认为这不可能在获取任何缺少的标题之前创建整个列表.

If you don't have moduleBCommon.h, then you can't know what other headers it #includes, so I don't think it's possible to create the whole list before obtaining any of the missing headers.

为什么不要求与库关联的所有头文件?谁负责提供这些库,已经因不提供它们而感到无聊,并且如果没有人知道哪些头文件与这些库一起提供,那么显然有人将源代码控制权弄混了,因此管理部门应容忍您的迭代请求.

Why can't you ask for all the header files associated with the libraries? Whoever is in charge of the libraries has already goofed by not providing them, and if nobody knows which header files go with the libraries then clearly someone has bungled the source control, so management should tolerate iterative requests from you.

(除非您的经理在技术上不称职,计算机不熟练且在逻辑上挑战MBA类型,这很有可能.)

(Unless your managers are technically incompetent, computer-illiterate, logically challenged MBA types, which is quite possible.)

这篇关于如何生成缺少的#include文件的列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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