From owner-freebsd-questions Thu Dec 17 18:09:14 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id SAA24723 for freebsd-questions-outgoing; Thu, 17 Dec 1998 18:09:14 -0800 (PST) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from allegro.lemis.com (allegro.lemis.com [192.109.197.134]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id SAA24703 for ; Thu, 17 Dec 1998 18:08:50 -0800 (PST) (envelope-from grog@freebie.lemis.com) Received: from freebie.lemis.com (freebie.lemis.com [192.109.197.137]) by allegro.lemis.com (8.9.1/8.9.0) with ESMTP id MAA12692; Fri, 18 Dec 1998 12:27:15 +1030 (CST) Received: (from grog@localhost) by freebie.lemis.com (8.9.1/8.9.0) id MAA11773; Fri, 18 Dec 1998 12:27:15 +1030 (CST) Message-ID: <19981218122715.H486@freebie.lemis.com> Date: Fri, 18 Dec 1998 12:27:15 +1030 From: Greg Lehey To: Peng HaiJie , freebsd-questions@FreeBSD.ORG Subject: Re: How to build static excutable program? References: <367A1D70.776909F1@www.transfar.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.91.1i In-Reply-To: <367A1D70.776909F1@www.transfar.com>; from Peng HaiJie on Fri, Dec 18, 1998 at 09:16:32AM +0000 WWW-Home-Page: http://www.lemis.com/~grog Organization: LEMIS, PO Box 460, Echunga SA 5153, Australia Phone: +61-8-8388-8286 Fax: +61-8-8388-8725 Mobile: +61-41-739-7062 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Friday, 18 December 1998 at 9:16:32 +0000, Peng HaiJie wrote: > It the first time that I make a static excutable program. > I have tried the following lines: > gcc -static -o foo foo.c > but gcc tells that there are some undefined references . > What is the matter? You've forgotten to specify some libraries. These ``undefined references'' messages tell you what you've forgotten. > How to build static excutable program?Please give me an > example $ gcc -static -o foo foo.c This is a typical example, of course, of ``I'd like to help you, but you haven't specified your problem''. Greg -- See complete headers for address, home page and phone numbers finger grog@lemis.com for PGP public key To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message