Subject: | |
From: | |
Reply To: | |
Date: | Fri, 17 Jan 1997 15:44:50 -0800 |
Content-Type: | text/plain |
Parts/Attachments: |
|
|
I have successfully installed gcc from jazz onto my 5.5 system.
For my first compile test, I chose ftp://prep.ai.mit.edu/pub/gnu/gzip-1.2.4.tar
and everything compiled fine. (Well, the make croaked because HP was too
cheap to implement hard links in additional to symbolic links, but that was
easy to change from hard to symbolic....)
For my next compile test, I tried ftp://rs.internic.net/netprog/whois.c.
After a while, I managed to compile cleanly via:
gcc -D_SOCKET_SOURCE -o whois whois.c
But when I run whois, it dies:
shell/iX> ./whois
UNRESOLVED EXTERNALS: gethostbyaddr (LDRERR 512)
UNRESOLVED EXTERNALS: connect (LDRERR 512)
UNRESOLVED EXTERNALS: socket (LDRERR 512)
UNRESOLVED EXTERNALS: gethostbyname (LDRERR 512)
**** EXEC FUNCTION FAILED; subsys =517; info = 48
ABORT: /usr/contrib/src/whois
NM SYS a.00ac2288 dbg_abort_trace+$24
[1] + Done (134) ./whois
1836023 Abort ./whois
So I poked around and found /usr/lib/libsocket.a that I assume I need to link
with in order to resolve the missing externals. So I then tried:
gcc -D_SOCKET_SOURCE -L/usr/lib -lsocket -o whois whois.c
No nasty errors, but still the same unresolved externals at run time. So then
I tried:
gcc -D_SOCKET_SOURCE -o whois.o whois.c
ld -L/usr/lib -lsocket -o whois whois.o
But the link dies:
WARNING: ./whois.o HAS FILECODE 1030
./whois.o: NOT A VALID OBJECT FILE (INVALID MAGIC NUMBER) (LINKERR 3031)
LINK FAILED (LINKERR 1116)
linkedit.pub.sys
"link;from=^/tmp/c89003102CF.aaa;to=./whois;posix;share;cap=ph";parm=7
Program terminated in an error state. (CIERR 976)
ld: error: link failed
So what's the magic trick I need to do to link with external libraries?
Once I've resolved these minor learning curve things, I'm going to take a stab
at compiling/porting the Apache web server (www.apache.org; what I run for
HPUX). Without having tried to compile it yet, I can't comment about how
feasible it will be.
--
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)
|
|
|