This question already has answers here:
Displaying the #include hierarchy for a C++ file in Visual Studio

(9个答案)


2年前关闭。




当.cpp文件中的一系列包含文件包含的头文件中出现构建错误时,如何使Visual Studio显示包含文件的整个链?

例如,
fatal error C1083: Cannot open include file: 'abc.h': No such file or directory

我希望它也可以打印类似
included from 'xyz.h', included from 'efg.h', included from 'main.cpp'

最佳答案

您可以使用/showIncludes选项,可以在C/C++-> Advanced部分找到。它将转储完整的包含树。

07-24 12:41