The case of the missing errno.

New Articles

Clean up Spilled Tar.

Kerberos, where art though kerberos.

Directory Browsing with PHP.

Ever seen anything like this?

	collect2: ld returned 1 exit status
	make[2]: *** [mysql] Error 1
	make[2]: Leaving directory `/opt/mysql-3.23.37/client'
	make[1]: *** [all-recursive] Error 1
	make[1]: 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;

with


	#include <errno.h>

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

Copyright © Raditha Dissanayake 2013