Undefined characters for x86_64 architecture: (Mac OS X 10.7)

I am working on MP for my CS class. Our computer labs are running Linux, but I tried to compile the code on my home computer (Mac OS X). I get 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 to find a solution on the Internet, but I was unsuccessful. We use the following macros in the Makefile:

CC = gcc
INC = -I.
FLAGS = -g -W -Wall
LIBS = -lpthread

Any ideas?

+3
source share
1 answer

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)

+2

All Articles