This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
Re: c++/4171: unresolved __gxx_personality_v0 in simple namespace example
- To: nobody at gcc dot gnu dot org
- Subject: Re: c++/4171: unresolved __gxx_personality_v0 in simple namespace example
- From: Phil Edwards <pedwards at disaster dot jaj dot com>
- Date: 29 Aug 2001 17:46:01 -0000
- Cc: gcc-prs at gcc dot gnu dot org,
- Reply-To: Phil Edwards <pedwards at disaster dot jaj dot com>
The following reply was made to PR c++/4171; it has been noted by GNATS.
From: Phil Edwards <pedwards@disaster.jaj.com>
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