From owner-freebsd-hackers Wed Feb 4 10:39:20 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id KAA08095 for hackers-outgoing; Wed, 4 Feb 1998 10:39:20 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from fiscodata-pr.netpar.com.br (fiscodata-pr.netpar.com.br [200.255.244.88]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id KAA07970 for ; Wed, 4 Feb 1998 10:38:56 -0800 (PST) (envelope-from paulo@fiscodata-pr.netpar.com.br) Received: from fiscodata-pr.netpar.com.br (fiscodata-pr.netpar.com.br [200.255.244.88]) by fiscodata-pr.netpar.com.br (8.8.8/8.8.5) with SMTP id QAA15999; Wed, 4 Feb 1998 16:41:23 GMT Date: Wed, 4 Feb 1998 16:41:23 +0000 (GMT) From: Paulo Cesar Pereira de Andrade To: John Polstra cc: xavier@stlnet.com, hackers@FreeBSD.ORG Subject: Re: Problems linking shared libraries with ld In-Reply-To: <199802041713.JAA03080@austin.polstra.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG X-To-Unsubscribe: mail to majordomo@FreeBSD.org "unsubscribe hackers" On Wed, 4 Feb 1998, John Polstra wrote: > But the real problem is that you shouldn't be using "ld" directly > for linking. Use "cc" instead, like this: > > $(CC) -o autosize_html $(OBJS) $(LDFLAGS) $(LOADLIBES) > > The exact command for linking an executable is different on > practically every platform in existence. The "cc" command knows the > idiosyncrasies of your platform, and it does the right thing. It's a > much more portable way to build programs than using "ld" directly. > Complementing John's posting, since its a X program, you should use a Imakefile. Here's one that should fit your needs: ----------------- CDEBUGFLAGS = -g -Wall INCLUDES = -I/usr/local/include LOCAL_LIBRARIES = $(XMLIB) $(XTOOLLIB) $(XMULIB) $(XLIB) $(XPMLIB)\ -L/usr/local/lib -lXmHTML -ljpeg -lpng -lz -lm SimpleProgramTarget(autosize_html) ----------------- -- Don't get suckered in by the comments -- they can be terribly misleading. Debug only code. -- Dave Storer