Bug #5534 building with --with-berkeley-db requires linking with stdc++
Submitted: 13 Sep 2004 3:19 Modified: 4 Mar 2013 8:28
Reporter: Ian Holsman Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Compiling Severity:S4 (Feature request)
Version:4.1bk OS:MacOS (OS/X 10.3.5)
Assigned to: CPU Architecture:Any

[13 Sep 2004 3:19] Ian Holsman
Description:
when I run 
./configure --with-ndbcluster --with-isam --with-vio --with-openssl --prefix=/usr/local/mysql-4.1 --enable-thread-safe-client --with-berkeley-db --with-raid

I get 
ianh:/src/mysql-4.1/myisam ianh$ gcc -O -DDBUG_OFF -DHAVE_DARWIN_THREADS -D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ -DIGNORE_SIGHUP_SIGQUIT -o sp_test sp_test.o libmyisam.a ../mysys/libmysys.a ../dbug/libdbug.a ../strings/libmystrings.a -lz -lm         
ld: warning multiple definitions of symbol _qsort
../mysys/libmysys.a(mf_qsort.o) definition of _qsort in section (__TEXT,__text)
/usr/lib/libm.dylib(qsort.So) definition of _qsort
ld: Undefined symbols:
operator delete(void*)
operator new(unsigned long)

adding -lstd++ into my LDFLAGS fixes it

How to repeat:
run the configure line above.

Suggested fix:
add -lstdc++ to LDFLAGS when you enable berkerly-db
also a 'standard' compile-OSX in the BUILD directory would be nice as well ;-)
[4 Oct 2004 21:14] Matthew Lord
Hi,

Thanks for your bug report!

While I don't think we should add -lstd++ with berkely-db because it's not needed on other 
platforms, I do think that an OS-X BUILD/ file in our bk repository is a good idea.

I'm going to make this a feature request for that.

Best Regards
[11 Oct 2004 20:47] Sergei Golubchik
to avoid linking with stdc++ we have new/delete functions in mysys/my_new.cc
with -DUSE_MYSYS_NEW you should be able to use them.

But having OS X specific build script in BUILD/ will solve that :)
[4 Mar 2013 8:28] Yngve Svendsen
BDB support was removed as of 5.1.11 (see http://dev.mysql.com/doc/refman/5.1/en/source-configuration-options.html) and no further enhancements are planned for 5.0 and older.