1、查看test.cpp包含了哪些头文件
1.1 AIX
xlC -M test.cpp编译选项。编译完后后生成一个.u文件。
2.2 HP-UX
aCC -H test.cpp
2.3 Linux
g++ -M test.cpp
2、对test. cpp进行宏替换
cpp(The C Preprocessor )是unix编译器用来进行宏替换的工具。在编译的时候 ,有时遇到因宏替换而出现的问题,可以调用cpp 输出宏替换后的结果,这样就容易查问题了。
1.1 AIX
cpp test.cpp
xlC -E -c test.cpp
1.2 HP-UX
hpux的cpp工具在/lib/cpp
1.3 Linux
g++ - E
3、linux常用编译选项
-include file 默认包含头文件