Undefined symbols for architecture x86_64: (Mac OS X 10.7)
c, compiler-errors, makefile
Solution
From the GNU man page of tdestroy:
SVr4, POSIX.1-2001. The function tdestroy() is a GNU extension
This means that this function is not available on OS X
EDIT: Put this after the includes:
#ifndef _GNU_SOURCE
void tdestroy(void *root, void (*free_node)(void *nodep)) { }
#endif
You can try to implement tdestroy by using twalk/tdelete/free - it should'n be very hard to do, but leaving it empty should work too (but it will create a memory leak on OSX).
EDIT 2: added link to the man page (10x to Cameron)
Problem
I am working on an MP for my CS class. Our computer labs are working under Linux OS, but I tried compiling the code on my home computer (Mac OS X). I am getting the following error: ``` Undefined symbols for architecture x86_64: "_tdestroy", referenced from: _dictionary_destroy in libdictionary.o _dictionary_destroy_free in libdictionary.o ld: symbol(s) not found for architecture x86_64 ``` I tried finding a solution online, but I was unsuccessful. We are using the following macros in the Makefile: ``` CC = gcc INC = -I. FLAGS = -g -W -Wall LIBS = -lpthread ``` Any ideas?