Problem with gcc
David Miller - CATS
davidm at cbmvax.commodore.com
Wed May 22 01:29:16 AEST 1991
In article <1991May19.144743.25904 at nntp-server.caltech.edu> tll at nntp-server.caltech.edu (Tal Lewis Lancaster) writes:
|After compiling all of my .c files using gcc, I get the following
|message when it is trying to link:
|
|Undefined symbols First referenced in
|----------------------------------------------
|select /usr/lib/libsocket.so
|syslog /usr/lib/libsocket.so
|seteuid /usr/lib/libsocket.so
In article <1991May21.045217.19569 at csusac.csus.edu> emmonsl at athena.ecs.csus.edu (L. Scott Emmons) writes:
|The only way I could get socket stuff to work on my UX was to make sure that
|/usr/ucb was in the path before /usr/ccs. Also you need to execute gcc
|thusly:
|
| gcc -o file file.c -lsocket -lucb
| ^^^^^^^^ ^^^^^
|
|/usr/ucb/ld will complain about some library (libsocket.so, I think) being
|included twice, but it will work ok.
|
|Strangely 'nuff, if you want to compile&link programs which don't use sockets
|and BSD stuff, /usr/ucb must _not_ be in the path before /usr/ccs...very,very
|strange behavior!
By default, gcc and cc will use the System V include files and
libraries. To compile BSD programs, you need to do the following:
[g]cc -I/usr/ucbinclude -L/usr/ucblib -o file file.c -lsocket -lucb
This tells the preprocessor to look for include files in
/usr/ucbinclude before trying /usr/include and tells the linker to
look for libraries in /usr/ucblib.
DavidM
--
DavidM CATS - Commodore Applications and Technical Support
+1 215 431 9425 davidm at cbmvax.commodore.com
"Commodore Amiga 3000UX - Born to Run UNIX SVR4"
More information about the Comp.unix.amiga
mailing list