Is there a way to list all files included in a generic .cpp file? I need a list (flat) or a hierarchical tree that show all the included files from a .cpp file? Does the compilator has some flag to show them? or using another tool? how can i achieve taht?
Asked
Active
Viewed 107 times
1
-
3You should probably specify your compiler/platform but `g++` has the `-H` option. – G.M. Oct 21 '21 at 10:06
-
1At least g++ has the `-M
` options group to support GNU make dependency lists. – πάντα ῥεῖ Oct 21 '21 at 10:06 -
Further to the comment by πάντα ῥεῖ you might want to clarify the rationale for this. If it's for use as target dependencies in a `makefile` you should probably state that and add the `makefile` tag. You might also want to read [this](http://make.mad-scientist.net/papers/advanced-auto-dependency-generation/). – G.M. Oct 21 '21 at 10:20