[SunHELP] Basic port programming

Anthony J. Gabrielson agabriel at home.tzo.org
Wed May 15 13:37:58 CDT 2002


Thanks for the help - that fixed 2 of the problems.  I went looking
through the man page to see where you saw that, and I just didn't see
it.  I'm down to one error - do you know what I need to link against for
this error:

gcc -Xlinker /usr/lib/libsocket.so /usr/lib/libnsl.so getip.c
Undefined                       first referenced
 symbol                             in file
herror                              /var/tmp/ccJtpzXZ.o
ld: fatal: Symbol referencing errors. No output written to a.out
collect2: ld returned 1 exit status

Also is there a way to automate this.  Linux doesn't make me spec out the
link like this and I would prefer it if solaris was like that as well.

Thanks,
Anthony

On Wed, 15 May 2002, Dale Ghent wrote:

> On Wed, 15 May 2002, Anthony J. Gabrielson wrote:
> 
> | Hello all,
> | 	Trying to do some basic port programming and build on just a small
> | piece of code so I can understand it.  My solaris box is giving me a bit
> | of headache.  I'm taking, which runs fine under linux and cygwin and
> | compile it - it has other ideas.  Here are the errors I'm getting:
> | bash-2.03$ gcc getip.c
> | Undefined                       first referenced
> |  symbol                             in file
> | gethostbyname                       /var/tmp/cctNqaTN.o
> | inet_ntoa                           /var/tmp/cctNqaTN.o
> | herror                              /var/tmp/cctNqaTN.o
> | ld: fatal: Symbol referencing errors. No output written to a.out
> | collect2: ld returned 1 exit status
> 
> The socket man page would tell you that you need to link against two
> libraries: libsocket and libnsl
> 
> /dale



More information about the SunHELP mailing list