From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fa528,ad93a232f2009837 X-Google-Attributes: gidfa528,public X-Google-ArrivalTime: 2001-02-03 02:41:05 PST Path: supernews.google.com!sn-xit-02!supernews.com!nntp-relay.ihug.net!ihug.co.nz!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!intgwpad.nntp.telstra.net!news-server.bigpond.net.au!not-for-mail From: Mark Garrett Newsgroups: comp.unix.tru64 Subject: Re: c++(gcc) & gethostbyname Organization: Garetech Computer Solutions Message-ID: References: <3A7AA2D0.5FCF4355@hrem.stm.tudelft.nl> Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit User-Agent: Microsoft-Outlook-Express-Macintosh-Edition/5.02.2022 Date: Sat, 03 Feb 2001 10:48:45 GMT NNTP-Posting-Host: 144.132.244.163 X-Complaints-To: news@bigpond.net.au X-Trace: news-server.bigpond.net.au 981197325 144.132.244.163 (Sat, 03 Feb 2001 21:48:45 EST) NNTP-Posting-Date: Sat, 03 Feb 2001 21:48:45 EST Xref: supernews.google.com comp.unix.tru64:1635 in article 3A7AA2D0.5FCF4355@hrem.stm.tudelft.nl, Jouk Jansen at joukj@hrem.stm.tudelft.nl wrote on 02/02/2001 22:06: > Hi all, > > Is it a known problem that c++(gcc) cannot include gethostbyname? > gcc, and Compaq's cc and cxx seem to work well (see example below) > > Jouk > > > > > focus-jj) cc test.c > focus-jj) gcc test.c > focus-jj) ren test.c test.cpp > focus-jj) c++ test.cpp > /usr/ucb/ld: > Unresolved: > gethostbyname(char const *) > collect2: ld returned 1 exit status > focus-jj) cxx test.cpp > cat test.cpp Looks like your gcc is screwed up - it works for me :- root@ned> cc -V Compaq C V6.3-027 on Compaq Tru64 UNIX V5.1 (Rev. 732) Compiler Driver V6.3-026 (sys) cc Driver root@ned> cxx -V Compaq C++ V6.3-003 for Compaq Tru64 UNIX V5.1 (Rev. 732) Compiler Driver V6.3-003 (cxx) cxx Driver root@ned> gcc --version 2.8.1 root@ned> cat test.c #include main() { struct hostent* he; he = gethostbyname( "testje" ); } root@ned> cc test.c root@ned> gcc test.c root@ned> mv test.c test.cpp root@ned> gcc test.cpp Cheers Mark ;)