2
I’m having problems running Makefile.
main: ex09.o funcao1.o
gcc -c ex09.o funcao1.o -o main
ex09.o: ex09.c
gcc -c ex09.c
funcao1.o: funcao1.c funcao1.h
gcc -c funcao1.c
clean:
rm *.o
One of Linker errors that is generated
gcc -c ex09.o funcao1.o -o main
gcc: warning: ex09.o: linker input file unused because linking not done
gcc: warning: funcao1.o: linker input file unused because linking not done
Now the error that appears to me is this : gcc ex09.o funcao1.o -o main funcao1.o: In Function sort_without_resp': funcao1.c:(.text+0xa8): Multiple Definition of sort_without_resp' ex09.o:ex09.c:(.text+0xa): first defined here collect2: error: Ld 1 Exit status make: **[main] Error 1 - @Joseph X.
– Programador
@ José X: To be precise, the
-o
serves to name the generated file. You can use the-c
to only compile a source file and at the same time-o
to indicate the name of the object file. But I don’t know any practical use for this.– C. E. Gesser
@C. E. Gesser is, I "simplified" a little bit.
– zentrunix