Someone has posted about it but I can't find this answer. So, In VS, go to your project properties. Choose Configuration Properties / C/C++ / Advanced / Show Includes and set "yes".
then compile you cpp file. It looks like this: cpp file:
#include <stdio.h> int main() { return 0; }
In the output window after compiling you will see:
1>------ Build started: Project: stlport_project, Configuration: Release Win32 ------ 1>Compiling... 1>stlport_project.cpp 1>Note: including file: D:\src\hrs_rt_059.00\HRS\modules\src\libs\src\external\stlport\5.1.7\stdio.h 1>Note: including file: D:\src\hrs_rt_059.00\HRS\modules\src\libs\src\external\stlport\5.1.7\stl/_prolog.h 1>Note: including file: D:\src\hrs_rt_059.00\HRS\modules\src\libs\src\external\stlport\5.1.7\stl/config/features.h
and so on
EDIT: reference to the same question Displaying the #include hierarchy for a C++ file in Visual Studio
#includeother headers. And if there is conditional inclusion, calling grep again on the results of the first grep will not give useful results.