From owner-freebsd-questions Thu Dec 17 18:39:57 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id SAA28492 for freebsd-questions-outgoing; Thu, 17 Dec 1998 18:39:57 -0800 (PST) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from www.transfar.com ([202.103.100.88]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id SAA28432 for ; Thu, 17 Dec 1998 18:38:48 -0800 (PST) (envelope-from phj@www.transfar.com) Received: from www.transfar.com ([202.103.100.243]) by www.transfar.com (Netscape Mail Server v2.02) with ESMTP id AAA6073; Fri, 18 Dec 1998 10:37:42 +0800 Message-ID: <367A31E5.753893E9@www.transfar.com> Date: Fri, 18 Dec 1998 10:43:50 +0000 From: Peng HaiJie X-Mailer: Mozilla 4.07 [en] (X11; I; FreeBSD 2.2.8-RELEASE i386) MIME-Version: 1.0 To: Greg Lehey CC: freebsd-questions@FreeBSD.ORG Subject: Re: How to build static excutable program? References: <367A1D70.776909F1@www.transfar.com> <19981218122715.H486@freebie.lemis.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Thanks for your help. The compille error messages(generated on SUN Ultra 1 ,Solaris 2.6 ) are gcc -static -L/usr/lib -lXm -L/usr/openwin/lib -lXt -lX11 -L/usr/local/X11 /lib -lXpm -lm init.o sh.o is.o ic.o ibb.o im.o lpfx.o fp.o misc.o irb.o it.o graphics.o draw.o dam.o main.o -o txwg Undefined first referenced symbol in file IceProcessMessages /usr/openwin/lib/libXt.a(Shell.o) SmcDeleteProperties /usr/openwin/lib/libXt.a(Shell.o) dlclose /usr/openwin/lib/libX11.a(XsunDL.o) SmcSaveYourselfDone /usr/openwin/lib/libXt.a(Shell.o) SmcGetIceConnection /usr/openwin/lib/libXt.a(Shell.o) SmcRequestSaveYourselfPhase2 /usr/openwin/lib/libXt.a(Shell.o) SmcSetProperties /usr/openwin/lib/libXt.a(Shell.o) XSolarisIASetProcessInfo /usr/openwin/lib/libX11.a(OpenDis.o) SmcClientID /usr/openwin/lib/libXt.a(Shell.o) SmcCloseConnection /usr/openwin/lib/libXt.a(Shell.o) SmcOpenConnection /usr/openwin/lib/libXt.a(Shell.o) SmcModifyCallbacks /usr/openwin/lib/libXt.a(Shell.o) IceConnectionNumber /usr/openwin/lib/libXt.a(Shell.o) SmcInteractDone /usr/openwin/lib/libXt.a(Shell.o) dlsym /usr/openwin/lib/libX11.a(XsunDL.o) dlopen /usr/openwin/lib/libX11.a(XsunDL.o) SmcInteractRequest /usr/openwin/lib/libXt.a(Shell.o) dlerror /usr/lib/libnsl.a(netdir.o) make: *** [txwg] Error 1 Greg Lehey wrote: > 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 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message