Chinaunix首页 | 论坛 | 博客
  • 博客访问: 913103
  • 博文数量: 132
  • 博客积分: 9976
  • 博客等级: 中将
  • 技术积分: 1781
  • 用 户 组: 普通用户
  • 注册时间: 2007-08-30 20:40
文章分类

全部博文(132)

文章存档

2013年(1)

2011年(1)

2010年(15)

2009年(77)

2008年(36)

2007年(2)

我的朋友

分类: C/C++

2009-06-08 14:51:48

linker input file unused since linking not done

=================================================================================
from:


This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the .


Index Nav: [] [] [] []
Message Nav: [] [] [] []

Re: error message : linker input file unused since linking not done

  • To: "Thomas Singleton [Eidos]"
  • Subject: Re: error message : linker input file unused since linking not done
  • From: "Peter A. Friend"
  • Date: Sat, 25 Dec 1999 23:38:11 -0800 (PST)
  • cc: help-gcc at gnu dot org
  • Newsgroups: gnu.gcc.help
  • References: <>

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


  • Follow-Ups:
      • From: Peter A. Friend
  • References:
      • From: Thomas Singleton [Eidos]
Index Nav: [] [] [] []
Message Nav: [] [] [] []

=================================================================================



阅读(1475) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~