Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 4 Feb 1998 16:41:23 +0000 (GMT)
From:      Paulo Cesar Pereira de Andrade <paulo@fiscodata-pr.netpar.com.br>
To:        John Polstra <jdp@polstra.com>
Cc:        xavier@stlnet.com, hackers@FreeBSD.ORG
Subject:   Re: Problems linking shared libraries with ld
Message-ID:  <Pine.BSF.3.96.980204154938.13894A-100000@fiscodata-pr.netpar.com.br>
In-Reply-To: <199802041713.JAA03080@austin.polstra.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.96.980204154938.13894A-100000>