如何快速调试C++包含文件问题

sma*_*rte 5 c++ debugging compiler-errors

我们经常会遇到这样的问题,如下所示:

1>Compiling...
1>a.cpp
1>c:\apps\b.h(22) : fatal error C1083: Cannot open include file: 'boost/shared_ptr.hpp': No such file or directory
Run Code Online (Sandbox Code Playgroud)

有时它可能会很乏味,因为在一个大项目中有很多包含文件,甚至嵌套包含文件。

跟踪/哪个包含文件是包含有问题的包含文件的罪魁祸首(父级)的最佳方法是什么?

问题是它有嵌套的包含,所以需要花费一些努力才能知道哪个文件实际包含 bh

due*_*l0r 0

Autotools有这个功能。您可以检查某些头文件是否存在。我确信其他构建工具也具有类似的功能...