This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: undefined reference to `__errno_location(void)'


>>>>> "GRE" == GRE Spam Mail <gre_spam@anora.org> writes:

    GRE> On Wed, 04 Sep 2002 09:27:52 +0200 bjorn rohde jensen
    GRE> <bjensen@fastmail.fm> wrote:

    >> Hi Gordon,
    >> 
    >> Could you post some (small) code demonstrating the problem?  I
    >> think, you might be confusing ld's in its handling of
    >> weak/strong symbols during linking. It would be nice with some
    >> code to experiment with:)
    >> 
    >> Yours sincerely,
    >> 
    >> Bjorn
    >> 
    >> 

    GRE> Sure enough! Here's the smallest code that I've written that
    GRE> has this problem.

    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 ());


Claudio


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]