public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* error message : linker input file unused since linking not done
@ 1999-12-25 15:19 Thomas Singleton [Eidos]
  1999-12-25 23:38 ` Peter A. Friend
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Thomas Singleton [Eidos] @ 1999-12-25 15:19 UTC (permalink / raw)
  To: help-gcc

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

Thank you for any advices
Thomas

i'm using RH 6.0 with kernel 2.2.5-15 and gcc --version reported :
egcs-2.91.66


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: error message : linker input file unused since linking not done
  1999-12-25 15:19 error message : linker input file unused since linking not done Thomas Singleton [Eidos]
@ 1999-12-25 23:38 ` Peter A. Friend
  1999-12-25 23:43   ` Peter A. Friend
  1999-12-31 22:24   ` Peter A. Friend
  1999-12-26  1:42 ` error message : linker input file unused since linking not done SOLVED Thomas Singleton [Eidos]
  1999-12-31 22:24 ` error message : linker input file unused since linking not done Thomas Singleton [Eidos]
  2 siblings, 2 replies; 8+ messages in thread
From: Peter A. Friend @ 1999-12-25 23:38 UTC (permalink / raw)
  To: Thomas Singleton [Eidos]; +Cc: help-gcc

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: error message : linker input file unused since linking not done
  1999-12-25 23:38 ` Peter A. Friend
@ 1999-12-25 23:43   ` Peter A. Friend
  1999-12-31 22:24     ` Peter A. Friend
  1999-12-31 22:24   ` Peter A. Friend
  1 sibling, 1 reply; 8+ messages in thread
From: Peter A. Friend @ 1999-12-25 23:43 UTC (permalink / raw)
  To: Thomas Singleton [Eidos]; +Cc: help-gcc

On Sat, 25 Dec 1999, Peter A. Friend wrote:

> 
> 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.

Sorry, I forgot to mention something actually helpful. ;-) What you
probably want to do as the last step is:

gcc -o hello hello.o

or something similar. If those commands were typed verbatim out of the
book, then the book has an error in it. Note that this is simply a long
winded version of:

gcc -o hello hello.c

Which does the same thing.

Peter

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: error message : linker input file unused since linking not done SOLVED
  1999-12-25 15:19 error message : linker input file unused since linking not done Thomas Singleton [Eidos]
  1999-12-25 23:38 ` Peter A. Friend
@ 1999-12-26  1:42 ` Thomas Singleton [Eidos]
  1999-12-31 22:24   ` Thomas Singleton [Eidos]
  1999-12-31 22:24 ` error message : linker input file unused since linking not done Thomas Singleton [Eidos]
  2 siblings, 1 reply; 8+ messages in thread
From: Thomas Singleton [Eidos] @ 1999-12-26  1:42 UTC (permalink / raw)
  To: help-gcc

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 899 bytes --]

Problem solved,
Thanx to Peter A. Friend

Thomas Singleton

Thomas Singleton [Eidos] <singleton@skynet.be> a écrit dans le message :
843j8g$len$1@news0.skynet.be...
> 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
>
> Thank you for any advices
> Thomas
>
> i'm using RH 6.0 with kernel 2.2.5-15 and gcc --version reported :
> egcs-2.91.66
>
>


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: error message : linker input file unused since linking not done
  1999-12-25 23:43   ` Peter A. Friend
@ 1999-12-31 22:24     ` Peter A. Friend
  0 siblings, 0 replies; 8+ messages in thread
From: Peter A. Friend @ 1999-12-31 22:24 UTC (permalink / raw)
  To: Thomas Singleton [Eidos]; +Cc: help-gcc

On Sat, 25 Dec 1999, Peter A. Friend wrote:

> 
> 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.

Sorry, I forgot to mention something actually helpful. ;-) What you
probably want to do as the last step is:

gcc -o hello hello.o

or something similar. If those commands were typed verbatim out of the
book, then the book has an error in it. Note that this is simply a long
winded version of:

gcc -o hello hello.c

Which does the same thing.

Peter

^ permalink raw reply	[flat|nested] 8+ messages in thread

* error message : linker input file unused since linking not done
  1999-12-25 15:19 error message : linker input file unused since linking not done Thomas Singleton [Eidos]
  1999-12-25 23:38 ` Peter A. Friend
  1999-12-26  1:42 ` error message : linker input file unused since linking not done SOLVED Thomas Singleton [Eidos]
@ 1999-12-31 22:24 ` Thomas Singleton [Eidos]
  2 siblings, 0 replies; 8+ messages in thread
From: Thomas Singleton [Eidos] @ 1999-12-31 22:24 UTC (permalink / raw)
  To: help-gcc

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

Thank you for any advices
Thomas

i'm using RH 6.0 with kernel 2.2.5-15 and gcc --version reported :
egcs-2.91.66


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: error message : linker input file unused since linking not done SOLVED
  1999-12-26  1:42 ` error message : linker input file unused since linking not done SOLVED Thomas Singleton [Eidos]
@ 1999-12-31 22:24   ` Thomas Singleton [Eidos]
  0 siblings, 0 replies; 8+ messages in thread
From: Thomas Singleton [Eidos] @ 1999-12-31 22:24 UTC (permalink / raw)
  To: help-gcc

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 899 bytes --]

Problem solved,
Thanx to Peter A. Friend

Thomas Singleton

Thomas Singleton [Eidos] <singleton@skynet.be> a écrit dans le message :
843j8g$len$1@news0.skynet.be...
> 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
>
> Thank you for any advices
> Thomas
>
> i'm using RH 6.0 with kernel 2.2.5-15 and gcc --version reported :
> egcs-2.91.66
>
>


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: error message : linker input file unused since linking not done
  1999-12-25 23:38 ` Peter A. Friend
  1999-12-25 23:43   ` Peter A. Friend
@ 1999-12-31 22:24   ` Peter A. Friend
  1 sibling, 0 replies; 8+ messages in thread
From: Peter A. Friend @ 1999-12-31 22:24 UTC (permalink / raw)
  To: Thomas Singleton [Eidos]; +Cc: help-gcc

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~1999-12-31 22:24 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-12-25 15:19 error message : linker input file unused since linking not done Thomas Singleton [Eidos]
1999-12-25 23:38 ` Peter A. Friend
1999-12-25 23:43   ` Peter A. Friend
1999-12-31 22:24     ` Peter A. Friend
1999-12-31 22:24   ` Peter A. Friend
1999-12-26  1:42 ` error message : linker input file unused since linking not done SOLVED Thomas Singleton [Eidos]
1999-12-31 22:24   ` Thomas Singleton [Eidos]
1999-12-31 22:24 ` error message : linker input file unused since linking not done Thomas Singleton [Eidos]

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).