public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Fw: undefined reference to `__errno_location(void)'
@ 2002-09-01 20:58 GRE Spam Mail
  0 siblings, 0 replies; only message in thread
From: GRE Spam Mail @ 2002-09-01 20:58 UTC (permalink / raw)
  To: gcc-help

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2002-09-02  3:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-09-01 20:58 Fw: undefined reference to `__errno_location(void)' GRE Spam Mail

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).