From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Peter A. Friend" To: "Thomas Singleton [Eidos]" Cc: help-gcc@gnu.org Subject: Re: error message : linker input file unused since linking not done Date: Sat, 25 Dec 1999 23:38:00 -0000 Message-id: References: <843j8g$len$1@news0.skynet.be> X-SW-Source: 1999-12/msg00351.html On Sun, 26 Dec 1999, Thomas Singleton [Eidos] wrote: > hello, > in order to follow a book's test procedure to see if the compiling/linking > of C programs work, i created a hello.c > file with the famous 'printf("Hello World!");' then (always following the > instructions) did : > $gcc -c -Wall -D_GNU_SOURCE hello.c -o hello.o > then > $gcc -c hello.o hello.c > which reported : > gcc: hello.o : linker input file unused since linking not done > > i made a search for that message on gcc.gnu.org, and found a few linked > messages but they were all about merging two or more source into the same > object which is not my case, so i decided to post this The message that gcc reported is correct. When you supply a library (even a compiled object file like you did) to a command that does no linking (gcc -c), gcc simply informs you that the library was not used because no linking was done. You didn't ask it to. Since you specified -c, "source" files are going to be compiled into .o object files, NOT into an executable, nor is anything going to be done with any object files. Gcc saw the extraneous object file supplied and simply ignored it. HTH, Peter --- Software Engineer EarthLink Network From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Peter A. Friend" To: "Thomas Singleton [Eidos]" Cc: help-gcc@gnu.org Subject: Re: error message : linker input file unused since linking not done Date: Fri, 31 Dec 1999 22:24:00 -0000 Message-ID: References: <843j8g$len$1@news0.skynet.be> X-SW-Source: 1999-12n/msg00351.html Message-ID: <19991231222400.zedi4nY8IOTo6fHnfSi4qd-J2UIUEe2gPoh3RhoLcw8@z> On Sun, 26 Dec 1999, Thomas Singleton [Eidos] wrote: > hello, > in order to follow a book's test procedure to see if the compiling/linking > of C programs work, i created a hello.c > file with the famous 'printf("Hello World!");' then (always following the > instructions) did : > $gcc -c -Wall -D_GNU_SOURCE hello.c -o hello.o > then > $gcc -c hello.o hello.c > which reported : > gcc: hello.o : linker input file unused since linking not done > > i made a search for that message on gcc.gnu.org, and found a few linked > messages but they were all about merging two or more source into the same > object which is not my case, so i decided to post this The message that gcc reported is correct. When you supply a library (even a compiled object file like you did) to a command that does no linking (gcc -c), gcc simply informs you that the library was not used because no linking was done. You didn't ask it to. Since you specified -c, "source" files are going to be compiled into .o object files, NOT into an executable, nor is anything going to be done with any object files. Gcc saw the extraneous object file supplied and simply ignored it. HTH, Peter --- Software Engineer EarthLink Network