Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/129.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/c/65.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/310.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ 如何知道符号来自的确切文件_C++_C_Visual Studio_Include_C Preprocessor - Fatal编程技术网

C++ 如何知道符号来自的确切文件

C++ 如何知道符号来自的确切文件,c++,c,visual-studio,include,c-preprocessor,C++,C,Visual Studio,Include,C Preprocessor,我有一个关于包含文件的问题 假设您使用的是来自windows标题的定义。当然,您可以知道定义宏的确切标题是什么。但问题是,我们能否获得包含链,并知道包含宏的路径是什么 我的结构如下 windows.h // a windows header defines a macro header1.h <- windows.h // a <- b means a includes b header2.h <- windows.h header3.h <- windoes.h he

我有一个关于包含文件的问题

假设您使用的是来自windows标题的定义。当然,您可以知道定义宏的确切标题是什么。但问题是,我们能否获得
包含
链,并知道包含宏的路径是什么

我的结构如下

windows.h // a windows header defines a macro

header1.h <- windows.h // a <- b means a includes b
header2.h <- windows.h
header3.h <- windoes.h
header4.h <- header1.h, header2.h
header5.h <- header1.h, header4.h, header3.h
windows.h//windows标头定义宏

header1.h在GCC6.3.0中,您可以使用
#pragma
技巧

$ cat so62875940.c #include <stdio.h> #pragma message "so62875940.c" int main(void) { puts("foo"); return 0; } $ gcc so62875940.c so62875940.c:2:9: note: #pragma message: so62875940.c #pragma message "so62875940.c" ^~~~~~~ $cat so62875940.c #包括 #布拉格语消息“so62875940.c” 内部主(空){ 看跌期权(“foo”); 返回0; } $gcc so62875940.c so62875940.c:2:9:注意:#pragma消息:so62875940.c #布拉格语消息“so62875940.c” ^~~~~~~
然后按照包含顺序…

我想这可能会对您有所帮助。您可以选择
Architecture->Generate Graph of Include Files/Generate code Map for solution,而无需构建

Related@ChrisMM是的,它以某种方式是相关的。但我只想简单地看到层次结构。如果我看了你的建议,我必须编译源代码,查看头文件的位置,然后获取层次结构。虽然我没有这样找到它,这就是为什么我说它是相关的,而不是重复的。