From owner-freebsd-questions@FreeBSD.ORG Thu Apr 19 15:09:00 2007 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9316A16A401 for ; Thu, 19 Apr 2007 15:09:00 +0000 (UTC) (envelope-from freebsd-questions-local@be-well.ilk.org) Received: from mail3.sea5.speakeasy.net (mail3.sea5.speakeasy.net [69.17.117.5]) by mx1.freebsd.org (Postfix) with ESMTP id 6F8E913C480 for ; Thu, 19 Apr 2007 15:09:00 +0000 (UTC) (envelope-from freebsd-questions-local@be-well.ilk.org) Received: (qmail 18719 invoked from network); 19 Apr 2007 15:08:59 -0000 Received: from dsl092-078-145.bos1.dsl.speakeasy.net (HELO be-well.ilk.org) ([66.92.78.145]) (envelope-sender ) by mail3.sea5.speakeasy.net (qmail-ldap-1.03) with SMTP for ; 19 Apr 2007 15:08:59 -0000 Received: by be-well.ilk.org (Postfix, from userid 1147) id CF49E28434; Thu, 19 Apr 2007 11:08:58 -0400 (EDT) To: "Desai\, Rajesh" References: <460801A4097E3D4CA04CC64EE6485848130E7C@ism-mail03.corp.ad.wrs.com> From: Lowell Gilbert Date: Thu, 19 Apr 2007 11:08:58 -0400 In-Reply-To: <460801A4097E3D4CA04CC64EE6485848130E7C@ism-mail03.corp.ad.wrs.com> (Rajesh Desai's message of "Wed\, 18 Apr 2007 08\:25\:26 +0200") Message-ID: <44bqhkqu45.fsf@be-well.ilk.org> User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.97 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: freebsd-questions@freebsd.org Subject: Re: undefined reference to environ X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: freebsd-questions@freebsd.org List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Apr 2007 15:09:00 -0000 "Desai, Rajesh" writes: > Hi, > > when i link my application witj -lc (libc). i get the following errors > > > /usr/lib/libc.a(getenv.o): In function `getenv': > getenv.o(.text+0x19): undefined reference to `environ' > getenv.o(.text+0x29): undefined reference to `environ' > getenv.o(.text+0x63): undefined reference to `environ' > /usr/lib/libc.a(getenv.o): In function `__findenv': > getenv.o(.text+0xd5): undefined reference to `environ' > getenv.o(.text+0xe2): undefined reference to `environ' > /usr/lib/libc.a(getenv.o)(.text+0x113): more undefined references to `environ' follow > /usr/lib/libc.a(getprogname.o): In function `_getprogname': > getprogname.o(.text+0x4): undefined reference to `__progname' > > can any body help me what can be wrong..and where i cam dinf thease symbols. Those should be in the standard library also. Can you come up with a simple test case that demonstrates the problem? I can't reproduce anything like it on -STABLE.