Find headers required by a cpp file
In order to find out which headers each .cpp file requires, perform a g++ -MM file.cpp
. This lists out the dependencies for converting file.cpp
into an object file. man g++
and do a /-M
for the whole list of sub-options. -MM
does not list system libraries.
Leave a Comment