From the GNU tdestroy man page :
SVr4, POSIX.1-2001. The function tdestroy() is a GNU extension
This means that this feature is not available on OS X.
EDIT: Put this after inclusion:
#ifndef _GNU_SOURCE
void tdestroy(void *root, void (*free_node)(void *nodep)) { }
#endif
You can try to implement tdestroy with twalk / tdelete / free - this should be very difficult to do, but leaving it empty should work too (but this will create a memory leak in OSX).
EDIT 2: (10x Cameron)