I have .cpp file (text).I want to get the list of all files names which are included (#include) to this file. What is the best way to do it?(Need to implement it in C++)
gcc -M source.cpp
Replace -M
with -MM
if you don't care about the system includes.
Assuming you have a "find" or "grep", something along these lines:
g++ -E source.cpp | grep '\# 1 '
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With