When installing source package in Linux, have you seen this error message?

mysql.o(.text+0x1bda): In function `com_source(String*, char*)':
: undefined reference to `errno'
collect2: ld returned 1 exit status
make[2]: *** [mysql] Error 1
make[2]: Leaving directory `/opt/mysql-3.23.49/client'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/opt/mysql-3.23.49'
make: *** [all-recursive-am] Error 2

I got this when installing mysql-3-23.49. At first, I just think that it’s because the MySQL version is not relevant anymore.

In fact the error is appear because the compiler does not include the header file ‘error.h’ when compiling the source package.

So, the soulusion is to find out files which needs error.h, it’s contain line:

extern int errno;

By using ‘grep’ or ‘mc’ or other script (I prefer mc, because it’s easier), then just include error.h header file to those files by add this line:

#include error.h 

Popularity: 33% [?]