This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
RE: Differences from gcc-2.95 to gcc-2.97
- To: 'Mohamed Ezz' <ezz at peregrine dot com>, gcc-help at gcc dot gnu dot org
- Subject: RE: Differences from gcc-2.95 to gcc-2.97
- From: David Korn <dkorn at pixelpower dot com>
- Date: Thu, 22 Mar 2001 12:50:27 -0000
- Cc: ezz
>-----Original Message-----
>From: Mohamed Ezz [mailto:ezz@peregrine.com]
>Sent: 22 March 2001 00:53
>[SNIP] When I use gcc-2.95, my source code compiles and links;
>however, with gcc-2.97, there are some undefined symbols. Here is the
>output:
>__cxa_pure_virtual ../../../tmp/objopt/iddscan/app.o
>vtable for
>__cxxabiv1::__si_class_type_info../../../tmp/objopt/iddscan/app.o
>vtable for
>__cxxabiv1::__vmi_class_type_info../../../tmp/objopt/iddscan/app.o
>operator new[](unsigned) ../../../tmp/objopt/iddscan/idd.o
>vtable for
>__cxxabiv1::__class_type_info../../../tmp/objopt/iddscan/app.o
>operator delete(void*) ../../../tmp/objopt/iddscan/app.o
>operator new(unsigned) ../../../tmp/objopt/iddscan/app.o
>operator delete[](void*) ../../../tmp/objopt/iddscan/app.o
>ld: fatal: Symbol referencing errors. No output written to myTarget
>collect2: ld returned 1 exit status
>
>Is this because I should link against a certain library with the -l
>option? BTW, my arguments are:
I would have thought operator new/delete etc. all lived in libstdc++,
so you need to link against that...... but
>gcc -Wl,-s -Wl,-Beliminate -L/usr/lib < a bunch of object files> -lm
>-ldl -lposix4 -lthread -lsocket -lresolv -lnsl -o myTraget -Wl,-m
...if you had used g++ instead of gcc it would have been taken care
of for you automatically. Unless you're getting up to something *very*
tricky, you should always use g++, not gcc, for compiling C++ source code.
DaveK
--
All your base are belong to us!
**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.
This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.
www.mimesweeper.com
**********************************************************************