From mboxrd@z Thu Jan 1 00:00:00 1970 From: Phil Edwards To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org Subject: Re: c++/4171: unresolved __gxx_personality_v0 in simple namespace example Date: Wed, 29 Aug 2001 10:46:00 -0000 Message-id: <20010829174601.32262.qmail@sourceware.cygnus.com> X-SW-Source: 2001-08/msg00721.html List-Id: The following reply was made to PR c++/4171; it has been noted by GNATS. From: Phil Edwards To: dpollard@scitools.com Cc: gcc-gnats@gcc.gnu.org Subject: Re: c++/4171: unresolved __gxx_personality_v0 in simple namespace example Date: Wed, 29 Aug 2001 12:20:46 -0400 On Wed, Aug 29, 2001 at 01:33:40PM -0400, dpollard@scitools.com wrote: > >Description: > Compiling this simple 3 line file results in the unresolveable > symbol __gxx_personality_v0. > > >How-To-Repeat: > File Main.cpp: > namespace Test { void test(); } > using namespace Test; > int main() { test(); } > > % gcc -c Main.cpp > % nm Main.o > U _ZN4Test4testEv > 00000000 ? __FRAME_BEGIN__ > U __gxx_personality_v0 > 00000000 T main 'U' means undefined, not unresolvable. If you had called fopen() it would also should up as 'U' because fopen() is not defined in your code. You are compiling, not linking. __gxx_personality_v0 is defined in a library, like fopen and strcmp and cout and malloc and.... If you link your program in addition to just compiling it, the external symbols will be resolved. Since you are writing C++, we recommend you use g++ (or c++) to do the linking step, rather than gcc: gcc -c Main.cpp g++ Main.o ./a.out Luck++; Phil -- Would I had phrases that are not known, utterances that are strange, in new language that has not been used, free from repetition, not an utterance which has grown stale, which men of old have spoken. - anonymous Egyptian scribe, c.1700 BC