From owner-freebsd-questions Fri Jul 26 21:44:14 1996 Return-Path: owner-questions Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id VAA08618 for questions-outgoing; Fri, 26 Jul 1996 21:44:14 -0700 (PDT) Received: from freenet.hamilton.on.ca (main.freenet.hamilton.on.ca [199.212.94.65]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id VAA08613 for ; Fri, 26 Jul 1996 21:44:11 -0700 (PDT) Received: from james.freenet.hamilton.on.ca (james.freenet.hamilton.on.ca [199.212.94.66]) by freenet.hamilton.on.ca (8.7.5/8.7.3) with ESMTP id AAA05944; Sat, 27 Jul 1996 00:44:03 -0400 (EDT) Received: (from ac199@localhost) by james.freenet.hamilton.on.ca (8.7.5/8.7.3) id AAA13285; Sat, 27 Jul 1996 00:45:42 -0400 (EDT) Date: Sat, 27 Jul 1996 00:45:41 -0400 (EDT) From: Tim Vanderhoek To: Christian cc: questions@FreeBSD.org Subject: Re: C GURUS: How to link three object files together ? In-Reply-To: <8B5A8A3C84@mercury.csg.peachnet.edu> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-questions@FreeBSD.org X-Loop: FreeBSD.org Precedence: bulk On Fri, 26 Jul 1996, Christian wrote: > I am trying to build a small program that I got from somebody > else. The program was created on solaris 2.4 and the makefile is a > solaris 2.4 makefile. I typed make all and FreeBSD successfully > compiled the .c files into .o files, but when it tries to link the > files I get the following error message: > > -o appletgateway tcp_clt.o tcp_srv.o util.o > -o: not found > *** Error code 1 I'd say it's trying to execute a file called `-o', offhand. > Here is what the makefile looks like: > ------cut here----------------------------------------------- > CFLAGS = -O > LDFLAGS = -lsocket -lnsl > > PROGRAMS = appletgateway > > AG_OBJECTS = tcp_clt.o tcp_srv.o util.o > > .KEEP_STATE: > > all: ${PROGRAMS} > > appletgateway: ${AG_OBJECTS} > ${LINK.c} -o $@ ${AG_OBJECTS} ${LDLIBS} This should be ${CC} ${CCFLAGS} ${LDFLAGS} -o $@ ${AG_OBJECTS} > clean: > rm -rf .make.sate core ${PROGRAMS} ${AG_OBJECTS} > --------cut here----------------------------------------------- > I know very little about C and even less about make. > Can somebody help me? I'm not at all familiar with Solaris, but looking at the Makefile, I suspect you're lucky it was a fairly simple one since it looks like Solaris does a number of things differently. It obviously expects ${LDFLAGS} to somehow morph into ${LDLIBS}. > Thanks In Advance, No promises it'll work... -- Outnumbered? Maybe. Outspoken? Never! tIM...HOEk