Let us assume you (already) have two object files a.o
and b.o
, their corresponding source file a.c
and b.c
and some common header ch.h
; then your (incorrect) command line
gcc -g -m32 -ansi -Wall -c -o *.o *
might be expanded as:
gcc -g -m32 -ansi -Wall -c -o a.o b.o a.c b.c ch.h a.o b.o
(actually, that would be even worse, e.g. if you have some Makefile
or some backup files from your editors like a.c~
, as remarked by William Pursell)
which would compile but not link, the files b.o a.c b.c ch.h a.o b.o
which does not means much.
You should understand that the shell is expanding first the arguments before executing any gcc
program (in a new process). To understand what is expanded, consider replacing gcc
by echo
(or by gcc -v
which would show what is really happening)
次に、GCC の呼び出しに関する GCC のドキュメントを読む必要があります。
実際には、 Advanced Bash Scripting Guide (おそらく間違いがあるかもしれません) やAdvanced Linux Programmingなどを読むのに数時間を費やす必要があります。いくつかのウィキペディアのページも読むのに役立ちます。