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 10:10:01 PST Message-ID: <3D21DE66.EF7AECD2@mindspring.com> Date: Tue, 02 Jul 2002 13:09:58 -0400 From: Atlant Schmidt Organization: Teradyne, Inc. Boston MA X-Mailer: Mozilla 4.79 [en] (X11; U; SunOS 5.8 sun4u) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.unix.tru64 Subject: Re: gcc and gethostbyname: where is the library References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 131.101.110.103 X-Trace: 2 Jul 2002 13:11:57 -0500, 131.101.110.103 Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed1.cidera.com!Cidera!cyclone1.gnilink.net!rent.teradyne.com!131.101.110.103 Xref: archiver1.google.com comp.unix.tru64:8036 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. Atlant