undefined reference to `__errno_location(void)'

Rupert Wood rup@kanat.pair.com
Wed Sep 4 09:20:00 GMT 2002


Claudio Bley wrote:

>     GRE> extern int errno;
>          ^^^^^^^^^^^^^^^^^
>
> Remove this line from your source. You get the error because errno is
> defined as a macro and the line is expanded to
>
> extern int (*__errno_location ());

Which, in that scope, is defined as a C++ symbol. Which is why it
didn't match the C __errno_location in libpthread.

The "d'oh" here is that the clue was in the title: it wouldn't have said
"(void)" if it was trying to match a C symbol because it wouldn't have
that information.

Oh well, we learn. (And good spot, Claudio!)

Rup.



More information about the Gcc-help mailing list