[log in to unmask] writes:
> I forgot... to compile and link in two steps i.e. gcc and ld
> you will have to add -c to the gcc command to tell it "compile
> to object code only, no linking to program desired". Otherwise
> the -o output file will be NMPRG (filecode 1030).
Whereas a one step build runs without unresolved externals but dies with the
invalid instruction problem, the following two step build works OK but the
run dies with an unresolved external of __main:
gcc -D_SOCKET_SOURCE -o whois.o -c whois
ld -L/usr/lib -lsocket -o whois whois.o
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.
--
Mark Bixby E-mail: [log in to unmask]
Coast Community College Dist. Web: http://www.cccd.edu/~markb/
District Information Services 1370 Adams Ave, Costa Mesa, CA, USA 92626-5429
Technical Support +1 714 438-4647
"You can tune a file system, but you can't tune a fish." - tunefs(1M)