From: Paul Pluzhnikov <ppluzhnikov@earthlink.net>
Subject: Re: gcc and gethostbyname: where is the library
Date: Tue, 02 Jul 2002 14:49:00 GMT [thread overview]
Message-ID: <m3heji6v8k.fsf@salmon.parasoft.com> (raw)
In-Reply-To: pan.2002.07.02.15.38.43.451953.6834@bigfoot.com
alex <alexandre.masselot@bigfoot.com> 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).
So it is a compilation problem. However I can not reproduce this
using gcc-2.95.3 on a 5.0 system.
Perhaps if you add 'extern "C" struct hostent *gethostbyname(const char *);'
somewhere after 'netdb.h' gcc will either stop C++mangling or tell you
where "bad" gethostbyname prototype is coming from.
Cheers,
--
In order to understand recursion you must first understand recursion.
next prev parent reply other threads:[~2002-07-02 14:49 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-07-02 13:38 gcc and gethostbyname: where is the library alex
2002-07-02 14:49 ` Paul Pluzhnikov [this message]
2002-07-02 17:09 ` Atlant Schmidt
2002-07-03 5:05 ` Paul Pluzhnikov
2002-07-03 7:48 ` alex
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox