test.cpp (预编译器: 头文件copy 宏替换等)> test.i (编译器)> test.s(汇编文件) (汇编器)> test.obj/test.o(目标文件) (链接器)> test.exe/test(可执行文件)
#include <iostream> #define PI 3.1415926 int main(int argc, char* argv[]) { std::cout << "PI is: " << PI << std::endl; return 0; }
g++ -E test.cpp -o test.i
g++ -S test.i -o test.s
g++ -C test.s -o test.o
g++ test.s -o test file test