Mohammedz.com

For Linux and Shell scripting.

Error: undefined reference to ‘errno’

2 Comments


Error: undefined reference to ‘errno’

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
stralloc.a alloc.a error.a env.a str.a case.a fs.a open.a
strerr.a(strerr_sys.o)(.text+0x8): In function `strerr_sysinit’:
: undefined reference to `errno’
substdio.a(substdi.o)(.text+0x2c): In function `oneread’:
: undefined reference to `errno’
substdio.a(substdo.o)(.text+0x43): In function `allwrite’:
: undefined reference to `errno’
alloc.a(alloc.o)(.text+0x48): In function `alloc’:
: undefined reference to `errno’
collect2: ld returned 1 exit status
make: *** [iftocc] Error 1
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This is the most often reported installation error. This is caused because the program does not contain the errno.h file.

I got the above errors while installing mess822 package (I was trying to integrate spamassassin with qmail).

You can fix this problem by modifying two configurations files. (Changes to any one of the conf file may work, but sometimes you may have to edit both confs).

Move present conf-cc to conf-cc.back and create a new conf-cc to read:
gcc -O2 -include /usr/include/errno.h

Do the following modifications In the error.h file.

remove the line:
extern int errno;

add the line:
#include <errno.h>

Now, the compilation should work fine.

Advertisements

2 thoughts on “Error: undefined reference to ‘errno’

  1. Thank you, it works! 🙂

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s