The case of the missing errno.
collect2: ld returned 1 exit status make: *** [mysql] Error 1 make: Leaving directory `/opt/mysql-3.23.37/client' make: *** [all-recursive] Error 1 make: Leaving directory `/opt/mysql-3.23.37' make: *** [all-recursive-am] Error 2
If you are on redhat 9.0 you probably have seen this many times when trying to compile various applications such as mysql or qmail. The compiler blows a gasket saying 'undefined reference to `errno'' This is caused by the compiler not picking up the errno.h header file as it does on other platforms. The solution is trivial. Just replace all occurances of
extern int errno;
The best place to look for this is in error.h in the source tree. If it's not there you can always rely on grep to do the trick.
grep 'errno' *.h -r
A similar problem occurs with krb5.h when you compile apps with SSL support