阿波罗的战车
大多数编译器都可以选择只运行预处理器。G.GCC提供-E: -E Stop after the preprocessing stage; do not run the compiler proper.
The output is in the form of preprocessed source code, which is sent
to the standard output.所以你可以跑:gcc -E foo.c如果找不到这样的选项,也可以在机器上找到C预处理器。它通常被称为CPP,并且可能已经在您的路径上了。这样调用它:cpp foo.c如果需要从其他目录中包含标头,则可以将-i/path/to/include/dir传递给这两个目录中的任何一个,就像对常规编译一样。对于Windows,我将把它留给其他海报来提供答案,因为我不是那里的专家。