Bug #7530 Compile fails: undefined reference to `operator delete(void*)'
Submitted: 24 Dec 2004 17:25 Modified: 6 Feb 2005 0:00
Reporter: Sergey Petrunya Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: Compiling Severity:S2 (Serious)
Version:5.0-bk OS:Linux (Gentoo 2004.3 x86)
Assigned to: CPU Architecture:Any

[24 Dec 2004 17:25] Sergey Petrunya
Description:
Compiling 5.0 tree on Gentoo Linux fails with error:
 undefined reference to `operator delete(void*)'
The failure has been happening with bk sources for a couple of weeks (can't remeber exact date when it started).  it happens both with compile-pentium-debug and compile-pentium-max.
4.1 tree compiles without problems.

How to repeat:
Try to compile 5.0 and get the following:

ccache gcc -O3 -DDBUG_OFF -Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare -Wwrite-strings -Wunused -mcpu=pentiumpro -O3 -fno-omit-frame-pointer -g -rdynamic -o myisamchk myisamchk.o  libmyisam.a ../mysys/libmysys.a ../dbug/libdbug.a ../strings/libmystrings.a -lz -lpthread -lcrypt -lnsl -lm -lpthread
../mysys/libmysys.a(raid.o)(.text+0xa5): In function `my_raid_create':
/home/psergey/mysql-5.0/mysys/raid.cc:119: undefined reference to `operator new(unsigned int)'
../mysys/libmysys.a(raid.o)(.text+0x13b):/home/psergey/mysql-5.0/mysys/raid.cc:130: undefined reference to `operator delete(void*)'
../mysys/libmysys.a(raid.o)(.text+0x195): In function `my_raid_open':
/home/psergey/mysql-5.0/mysys/raid.cc:141: undefined reference to `operator new(unsigned int)'
../mysys/libmysys.a(raid.o)(.text+0x22b):/home/psergey/mysql-5.0/mysys/raid.cc:152: undefined reference to `operator delete(void*)'
../mysys/libmysys.a(raid.o)(.text+0x786): In function `my_raid_close':
/home/psergey/mysql-5.0/mysys/raid.cc:279: undefined reference to `operator delete(void*)'
collect2: ld returned 1 exit status
make[2]: *** [myisamchk] Error 1
make[2]: Leaving directory `/home/psergey/mysql-5.0/myisam'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/psergey/mysql-5.0'

If one adds -lstd++ into LIBS in mysys/Makefile and myisam/Makefile one can finish the build.

Suggested fix:
Make it compile
[6 Feb 2005 0:00] MySQL Verification Team
I had the same problem with  2.6.9-vidalinux a Gentoo based Desktop but doing:

miguel@light mysql-5.0 $ export CXX=gcc

and running again:

miguel@light mysql-5.0 $ BUILD/compile-pentium-debug-max --prefix=/home/miguel/dbs/5.0

and was able to compile it without any problems.