where is alphasort() in S8?

i can't compile a source due to alphasort():
/usr/pkgsrc/pkgtools/pkgfind/work/pkgfind-20050804/pkgfind.c:138: error: `alphasort' undeclared (first use in this function)

on solaris 8, alphasort() is in /usr/ucbinclude/sys/dir.h
in solaris 10, it is in /usr/include/dirent.h
But in all cases, manual pages don't give extra flags to compile?

If i try to add "-I/usr/ucbinclude -L/usr/ucblib -lucb -Wl,-R/usr/ucblib", there are more errors...

Is there a workaround? a patch?
I compile with gcc 3.4.6