public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: GRE Spam Mail <gre_spam@anora.org>
To: gcc-help@gcc.gnu.org
Subject: Fw: undefined reference to `__errno_location(void)'
Date: Sun, 01 Sep 2002 20:58:00 -0000	[thread overview]
Message-ID: <20020901235838.59245c4c.gre_spam@anora.org> (raw)

I'm trying to use 'extern int errno' and 'strerror(errno)' in some code that
I'm writing. The code that I'm writing is in C++ and I have '#include <cerrno>'
in my main header file.

===

I get the following error when I compile:

/home/muvie/muvie/src/socket_class.c:211: undefined reference to 
`__errno_location(void)'

socket_class.c lines 203-211:
    int num_desc=0;
    static int select_return;
    int cur_desc;
    struct timeval wait;
    extern int errno;

    printf("%s\n",strerror(errno));

    select_return = 0;

===

I searched your lists and the only message that came close was:

Re: c++/4881: errno_location() not linked when creating static library
    This is not a GCC problem.  errno_location is defined
    in the GNU C library that comes with Linux.
   
    If you want errno_location to be defined in your code,
    then in your source, include
    #include <errno.h>
   
    And when you link make sure to add -lpthread,
    since the symbol for errno_location is defined
    in the libpthread library on Linux.
   
    This is not a gcc problem.

===

I tried this, but it did not get rid of the problem.

I'm using (gcc) g++ version 2.95.3 on Slackware Linux 8.1
(kernel 2.4.18). I have not upgraded my gcc from the version that
came with this operating system.

I also get this same problem on (gcc) g++ version 3.2 on Slackware 8.0
(kernel 2.4.18).

So what do I do?

===

Thank you for your attention,

Gordon R. Ellsworth, Jr.

-- 
A Galileo could no more be elected president of the United States than
he could be elected Pope of Rome.  Both high posts are reserved for men
favored by God with an extraordinary genius for swathing the bitter
facts of life in bandages of self-illusion.
		-- H. L. Mencken

                 reply	other threads:[~2002-09-02  3:58 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20020901235838.59245c4c.gre_spam@anora.org \
    --to=gre_spam@anora.org \
    --cc=gcc-help@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).