首页 > 解决方案 > 如何使 Visual Studio (C++) 显示“包含在”链中?

问题描述

当 .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'

标签: c++visual-studio

解决方案


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


推荐阅读