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-03 00:48:43 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!bloom-beacon.mit.edu!nycmny1-snh1.gtei.net!nycmny1-snf1.gtei.net!news.gtei.net!newsfeed-zh.ip-plus.net!news.ip-plus.net!not-for-mail From: alex Newsgroups: comp.unix.tru64 Subject: Re: gcc and gethostbyname: where is the library Date: Wed, 03 Jul 2002 09:48:12 +0200 Organization: Swisscom IP+ (post doesn't reflect views of Swisscom) Message-ID: References: NNTP-Posting-Host: 194.209.13.177 Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: rex.ip-plus.net 1025682512 15068 194.209.13.177 (3 Jul 2002 07:48:32 GMT) X-Complaints-To: abuse@ip-plus.net NNTP-Posting-Date: Wed, 3 Jul 2002 07:48:32 +0000 (UTC) User-Agent: Pan/0.11.2 (Unix) X-Comment-To: "alex" Xref: archiver1.google.com comp.unix.tru64:8052 Hi there, thanks for your help. With your tip, I could get into the observation that we have 2 netdb.h files (a dummy one in /usr/local/include and a good one into /usr/include) g++ was selecting the bad one by default. Tahnks for your help Alex On Tue, 02 Jul 2002 15:38:44 +0200, alex wrote: > Hello, > > I cannot figure out why gcc cannot link the following file: >>cat a.cpp > #include > main() > { > struct hostent* he; > > he = gethostbyname( "testje" ); > } > > >>gcc a.cpp > /usr/bin/ld: > Unresolved: > gethostbyname(char const *) > collect2: ld returned 1 exit status > >>gcc -v > Reading specs from > /usr/local/lib/gcc-lib/alphaev6-dec-osf5.1/2.95.3/specs gcc version > 2.95.3 20010315 (release) > > I've also installed gcc 3.0.4, of course without any success. > > Can anyone help me > It would be **greatly** appreciated > > Alex