Steps to reproduce. $ cat > main.cpp int main() { char *foo = new char[10]; delete foo; } $ g++ -c main.cpp $ g++ -o main1 main.o $ ar cr libmain.a main.o $ ranlib libmain.a $ g++ -o main2 libmain.a $ g++ -o main3 -L. -lmain ld: warning prebinding disabled because of undefined symbols ld: Undefined symbols: operator delete(void*) operator new[](unsigned long) ___gxx_personality_v0
Confirmed, correcting the summary as it is only true for -l. Also this is a regression from 3.3.3.
Patch here: <http://gcc.gnu.org/ml/gcc-patches/2004-09/msg02651.html>.
*** Bug 17694 has been marked as a duplicate of this bug. ***
Subject: Bug 17537 CVSROOT: /cvs/gcc Module name: gcc Changes by: sayle@gcc.gnu.org 2004-09-28 22:43:12 Modified files: gcc/cp : ChangeLog g++spec.c Log message: PR driver/17537 * g++spec.c (lang_specific_driver): Unrecognized libraries, other than -lc and -lm, may require linking against libstc++. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.4393&r2=1.4394 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/g++spec.c.diff?cvsroot=gcc&r1=1.46&r2=1.47
Now only a 3.4 regression.
Subject: Bug 17537 CVSROOT: /cvs/gcc Module name: gcc Branch: gcc-3_4-branch Changes by: sayle@gcc.gnu.org 2004-09-29 02:18:58 Modified files: gcc/cp : ChangeLog g++spec.c Log message: PR driver/17537 * g++spec.c (lang_specific_driver): Unrecognized libraries, other than -lc and -lm, may require linking against libstc++. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.3892.2.161&r2=1.3892.2.162 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/g++spec.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.41&r2=1.41.4.1
Fixed.