problem compiling gethostbyname_r with g++

Alexandre Oliva aoliva@redhat.com
Tue Dec 19 18:37:00 GMT 2000


On Dec 18, 2000, Kevin Su <ksu@kinaare.net> wrote:

> /tmp/ccBqm5JX.o: In function `main':
> /tmp/ccBqm5JX.o(.text+0xa): undefined reference to `__h_errno_location(void)'

Looks like this is the result of inappropriate name mangling.  Compile
with -save-temps and look for occurrences of this symbol in the
preprocessed source (*.ii).  Then, complain to the maintainer of the
file that contains that declaration (look for a line starting with `#'
before that declaration, in the preprocessed file) that the
declaration should declare this symbol as extern "C".  And note that
the C library is not part of GCC, so the maintainers of the culprit
header file are not the maintainers of GCC.

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist    *Please* write to mailing lists, not to me


More information about the Gcc-help mailing list