预处理: gcc -E *.c -o *.i 生成*.i文件
编译 : gcc -S *.i 生成*.s文件
intel : gcc -S *.i -masm=intel
汇编 gcc -c *.s 生成*.o文件
*a 静态库 相当于 win下的*.lib
*.so 共享库 相当于 win下的*.dll
静态库
创建hello.c 和 hello.h
hello.h
#ifndef HELLO_H
#define HELLO_H
int hello();
#endif
hello.c
#include<stdio.h>
int hello()
{
printf("XXXX");
return 0;
}
gcc -c hello.c
ar -r libhello.a hello.o
ar -t libhello.a