Oh, I am a newbie in GCC and MAC and Makefile. Today I intended to build a dynamic lib using MAC OS X and GCC 4.4.2, but when linking the .o files, the compiler complains like this:
Undefined symbols:
"___emutls_get_address", referenced from:
_malloc in michael.o
_malloc in michael.o
ld: symbol(s) not found
I googled this info, but I can't understand the results well, I wonder what does the symbol mean, and why lots of programs have this linking error. I also wonder what is the possible cause for this error, the linking command is:
g++ -Dx86 -D_GNU_SOURCE -D_REENTRANT -Wall -m32
-fno-strict-aliasing -fno-pic -O3 -ggdb
michael.o malloc_new.o -o libmichael.so
-lpthread -lm -lstdc++ -shared
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…