HP3000-L Archives

January 1997, Week 3

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Mark Klein <[log in to unmask]>
Reply To:
Mark Klein <[log in to unmask]>
Date:
Sun, 19 Jan 1997 14:41:15 PDT
Content-Type:
text/plain
Parts/Attachments:
text/plain (43 lines)
Mark Bixby sez:

>PS: If you can build and run ftp://rs.internic.net/netprog/whois.c on your
>machine, I'd be interested in seeing the exact gcc/ld command syntax you
>used.

Since this was posted after my response on Saturday, I must assume that
my response got toasted along the way. If this is a duplicate, I
apologize.

I don't understand the linking problem being experienced, but the
following command is a single step compile/link that works for me. I
picked up whois.c from rs.internic.net just to make sure I was using the
same source as Mark.

gcc -D_SOCKET_SOURCE "-Dbcopy(a,b,c)=memcpy(b,a,c)" -lsocket -o whois
whois.c

Note that the bcopy goo must be quoted. The purpose for this define is
that whois.c uses bcopy and it needs to be overridden. There is also a
bcopy that appears in the NL that is privileged and causes an
instruction protection error when whois tries to execute it. The define
"-Dbcopy(a,b,c)=memcpy(b,a,c)" causes the compiler to use memcpy instead
of bcopy.

I can only suspect that the direct use of ld is causing some of the
problem above. Try using gcc instead of ld for your link stage:

gcc -L/usr/lib -lsocket -o whois whois.o

This also works for me. Note that gcc uses some gcc specific libraries
that ld doesn't know about. Also note that the -L/usr/lib is not
required (use gcc -v to see what paths and libraries are being used). I
am also in the process of creating an ld script that will address some
of these issues (including shared libraries). But that isn't yet ready.

If you're still having problems, please contact me directly.

Regards,


M.

ATOM RSS1 RSS2