2016年4月5日 星期二

GCC使用方法

1. Compiler a source file
$ gcc -o hello hello.c
2. Compiler many source files
$ gcc -o hello hello.c func.c
3. Compiler source file with debug flag
$ gcc -g -o hello hello.c
4. 編譯動態連結
$ arm-linux-gcc -Wall -c -o hrt_timer.o hrt_timer.c
$ arm-linux-gcc -Wall -o hrt_timer hrt_timer.o -lrt
5. 編譯靜態連結
$ arm-linux-gcc -Wall -c -o hrt_timer.o hrt_timer.c
$ arm-linux-gcc -Wall -static -o hrt_timer hrt_timer.o -lrt
6. preprofessor
$ gcc -E

沒有留言:

張貼留言