From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fa528,c86f7555baa8a3af X-Google-Attributes: gidfa528,public X-Google-ArrivalTime: 2002-07-02 22:05:51 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!headwall.stanford.edu!newsfeed.news2me.com!newsfeed2.earthlink.net!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!newsread2.prod.itd.earthlink.net.POSTED!not-for-mail Sender: paul@salmon.parasoft.com Newsgroups: comp.unix.tru64 Subject: Re: gcc and gethostbyname: where is the library References: <3D21DE66.EF7AECD2@mindspring.com> From: Paul Pluzhnikov User-Agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Artificial Intelligence) Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 03 Jul 2002 05:05:52 GMT NNTP-Posting-Host: 24.205.81.188 X-Complaints-To: abuse@earthlink.net X-Trace: newsread2.prod.itd.earthlink.net 1025672752 24.205.81.188 (Tue, 02 Jul 2002 22:05:52 PDT) NNTP-Posting-Date: Tue, 02 Jul 2002 22:05:52 PDT Organization: EarthLink Inc. -- http://www.EarthLink.net Xref: archiver1.google.com comp.unix.tru64:8040 Atlant Schmidt writes: > Paul Pluzhnikov wrote: > > > alex writes: > > > > > I cannot figure out why gcc cannot link the following file: > > > >cat a.cpp > > ... > > > /usr/bin/ld: > > > Unresolved: > > > gethostbyname(char const *) > > > > What this means is that 'gethostbyname' has aquired C++ linkage, > > and the linker is now looking for gethostbyname__FPCc (which > > is not there). > > I mustn't understand the question/answer [:-)] because I > would have suggested: > > % gcc a.cpp -lnsl > > so that libnsl gets linked in. At least on Solaris, that's > where gethostbyname() lives. But the question was about Tru64, where: $ nm /shlib/libc.so | grep gethostbyname __gethostbyname | 0004395899947296 | T | 0000000000000008 __gethostbyname_local | 0004395900375248 | T | 0000000000000008 __gethostbyname_r | 0004395900385184 | T | 0000000000000008 gethostbyname | 0004395899947296 | T | 0000000000000008 gethostbyname_local | 0004395900375248 | T | 0000000000000008 gethostbyname_r | 0004395900385184 | T | 0000000000000008 and libnsl.{a,so} does not exist (at least not in any of the default directories). Cheers, -- In order to understand recursion you must first understand recursion.