Very often we encounter this kind of issues like below:
1>Compiling...
1>a.cpp
1>c:\apps\b.h(22) : fatal error C1083: Cannot open include f开发者_运维问答ile: 'boost/shared_ptr.hpp': No such file or directory
Sometimes it could be tedious as there a many include files and even nested include files in a big project.
What is the best way to trace / which include file is the culprit(parent) that include the problematic include file?
The problem is it has nested include, so will need to spend some effort before able to tell which file actually include b.h.
Looks like you're on Windows (thus maybe using Microsoft C/C++ compiler). In that case you can use the /showIncludes Option. Also see this SO answer.
This allows you to "visually" see which header file includes which, giving you some more information.
Update: Apparently GCC has some similar options.
Autotools has this feature. You can check whether certain header files are present or not.. I'm sure other build tools have similar features...
精彩评论