I have some C source files and I am using gcc
. I basically want to compile all of them and create one single object file. When I try:
gcc -c src1.c src2.c src3.c -o final.o
I get:
gcc: cannot specify -o with -c or -S with multiple files
If I try:
gcc -c src1.c src2.c src3.c
I get three different object files. How can I tell gcc
to compile all files to return one single object file (I also want to specify its name)? Thank you.
Maybe there is another more common approach to this, in this case please tell me.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…