Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
.cpp ファイル (テキスト) があります。このファイルに含まれる (#include) すべてのファイル名のリストを取得したいと考えています。それを行う最善の方法は何ですか?(C++で実装する必要があります)
gcc -M source.cpp
システム インクルードを気にしない場合は、に-M置き換えます。-MM
-M
-MM
「find」または「grep」があると仮定すると、次の行に沿ったものになります。
g++ -E source.cpp | grep '\# 1 '