Bug #19108 embeded build fails
Submitted: 14 Apr 2006 20:58 Modified: 2 May 2006 8:53
Reporter: Rasa Karapandza Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S2 (Serious)
Version:5.0.20 OS:MacOS (Mac OSX 10.4.6)
Assigned to: CPU Architecture:Any

[14 Apr 2006 20:58] Rasa Karapandza
Description:
When trying to build an Example 1 from http://dev.mysql.com/doc/refman/5.0/en/libmysqld-example.html

Build fails with the following message:
/usr/bin/ld: warning multiple definitions of symbol _qsort
/usr/local/mysql/lib/mysql/libmysqld.a(mf_qsort.o) definition of _qsort in section (__TEXT,__text)
/usr/lib/gcc/powerpc-apple-darwin8/4.0.1/../../../libSystem.dylib(qsort.So) definition of _qsort

How to repeat:
Build mysql from source with follwoing options:
CC=gcc CFLAGS="-O3 -fno-omit-frame-pointer" CXX=gcc CXXFLAGS="-O3
-fno-omit-frame-pointer -felide-constructors -fno-exceptions -fno-rtti"
./configure --prefix=/usr/local/mysql --with-embedded-server
--without-bench --with-mysqld-user=mysql --without-docs
--enable-thread-safe-client 

and I have tried to build the example with:
gcc example1.c -o example1  -lz -lmysqld -I/usr/local/mysql/include/mysql -L/usr/local/mysql/lib/mysql
[24 Apr 2006 12:58] Valeriy Kravchuk
Thank you for a problem report. Please, try to repeat with 5.0.20a and:

gcc example1.c -o example1  -lz \
`/usr/local/mysql/bin/mysql_config --include --libmysqld-libs`

In case of similar failure, please, try to build MySQL without 
--enable-thread-safe-client configure option, check again and inform about the results.
[2 May 2006 8:53] Rasa Karapandza
It works now. I stll get the warning about a multiple definitions of symbol _qsort
But the compiled program works.