Description:
Trying to link a program with libmysqld on MacOS 10.3, I get this error:
ld: warning multiple definitions of symbol _qsort
/Users/simsong/mysql-4.1.1-alpha//libmysqld/libmysqld.a(libmysys_mf_qsort.o) definition of _qsort
in section (__TEXT\
,__text)
/usr/lib/libSystem.dylib(qsort.So) definition of _qsort
ld: warning multiple definitions of symbol _regcomp
/Users/simsong/mysql-4.1.1-alpha//libmysqld/libmysqld.a(libregex_regcomp.o) definition of
_regcomp in section (__TEX\
T,__text)
/usr/lib/libSystem.dylib(regcomp.So) definition of _regcomp
ld: warning multiple definitions of symbol _regexec
/Users/simsong/mysql-4.1.1-alpha//libmysqld/libmysqld.a(libregex_regexec.o) definition of _regexec
in section (__TEX\
T,__text)
/usr/lib/libSystem.dylib(regexec.So) definition of _regexec
ld: warning multiple definitions of symbol _regfree
/Users/simsong/mysql-4.1.1-alpha//libmysqld/libmysqld.a(libregex_regfree.o) definition of _regfree
in section (__TEX\
T,__text)
/usr/lib/libSystem.dylib(regfree.So) definition of _regfree
ld: Undefined symbols:
So it looks like the library is being called out of libmysqld.a and is conflicting with what's in the system
libSystem.dylib. This is probably a MacOS-related bug, and I'll be filing a linker error with Apple's
bugreporter, too. Next I'll specifically remove these modules from the MacOS libmysqld.a and see if the
errors go away.
How to repeat:
"dm" is any test program.
make -k dm
g++-3.3 -o dm dm.o ../lib/libstream.a /Users/simsong/mysql-4.1.1-alpha//libmysqld/libmysqld.a
-L../lib -lstream -lss\
l -lcrypto
ld: warning multiple definitions of symbol _qsort
/Users/simsong/mysql-4.1.1-alpha//libmysqld/libmysqld.a(libmysys_mf_qsort.o) definition of _qsort
in section (__TEXT\
,__text)
/usr/lib/libSystem.dylib(qsort.So) definition of _qsort
ld: warning multiple definitions of symbol _regcomp
/Users/simsong/mysql-4.1.1-alpha//libmysqld/libmysqld.a(libregex_regcomp.o) definition of
_regcomp in section (__TEX\
T,__text)
/usr/lib/libSystem.dylib(regcomp.So) definition of _regcomp
ld: warning multiple definitions of symbol _regexec
/Users/simsong/mysql-4.1.1-alpha//libmysqld/libmysqld.a(libregex_regexec.o) definition of _regexec
in section (__TEX\
T,__text)
/usr/lib/libSystem.dylib(regexec.So) definition of _regexec
ld: warning multiple definitions of symbol _regfree
/Users/simsong/mysql-4.1.1-alpha//libmysqld/libmysqld.a(libregex_regfree.o) definition of _regfree
in section (__TEX\
T,__text)
/usr/lib/libSystem.dylib(regfree.So) definition of _regfree
ld: Undefined symbols:
_compress
_uncompress
_crc32
make: *** [dm] Error 1