GCC linker throws weird message.

S

Steven

I am compiling with GCC 3.2, and it works well enough. However,
sometimes when I try to link libraries, the linker throws
"NOTAD.o(.eh_frame+0x11):NOTAD.C: undefined reference to
`__gxx_personality_v0'". This never happened until about 3 days ago.

What is __gxx_personality_v0? The linker works for many libraries,
such as stdlib.h, strings.h, etc. However, sometimes it fails. In
this particular case, "signals.h" is causing the trouble. In other
times, "setjump.h", "gmp.h", and some other libraries cause the linker
to throw the error.

Does anyone know why GCC is doing this?

Thanks.
 
A

Allin Cottrell

Steven said:
I am compiling with GCC 3.2, and it works well enough. However,
sometimes when I try to link libraries, the linker throws
"NOTAD.o(.eh_frame+0x11):NOTAD.C: undefined reference to
`__gxx_personality_v0'". This never happened until about 3 days ago.

Not a C question. Try gnu.gcc.help. "gxx" suggests C++ to me,
though I could be wrong.

Allin Cottrell
 
T

Tim Prince

Steven said:
I am compiling with GCC 3.2, and it works well enough. However,
sometimes when I try to link libraries, the linker throws
"NOTAD.o(.eh_frame+0x11):NOTAD.C: undefined reference to
`__gxx_personality_v0'". This never happened until about 3 days ago.

Does anyone know why GCC is doing this?
gcc detects C++ code where you have told it to link only C library support.
 
E

E. Robert Tisdale

Tim said:
gcc detects C++ code where you have told it to link only C library support.
> man gcc
.
.
.
file.cc
file.cp
file.cxx
file.cpp
file.c++
file.C
C++ source code which must be preprocessed.
Note that, in .cxx,
the last two letters must both be literally x.
Likewise, .C refers to a literal capital C.
.
.
.
 
R

Rex

because your filename is in UPPER CASE gcc is treating it as a C++
source. rename extension to lower case (.c instead of .C) and it should
work.
 
J

jacob navia

Rex said:
because your filename is in UPPER CASE gcc is treating it as a C++
source. rename extension to lower case (.c instead of .C) and it should
work.

The error message was:

"NOTAD.o(.eh_frame+0x11):NOTAD.C: undefined reference to
`__gxx_personality_v0'".

Ahh, that's *very* clear!!!!!

What a clear error message. I am really impressed!
 
A

Allin Cottrell

jacob said:
The error message was:

"NOTAD.o(.eh_frame+0x11):NOTAD.C: undefined reference to
`__gxx_personality_v0'".

Ahh, that's *very* clear!!!!!

What a clear error message. I am really impressed!

Well, once you put your thinking cap on, the reference to
"NOTAD.C" is fairly self-explanatory. Someone has ported
source files from a case-insensitive OS to a case-sensitive
one without paying attention, and has paid the price.

Allin Cottrell
 
D

DHOLLINGSWORTH2

Tim Prince said:
gcc detects C++ code where you have told it to link only C library
support.
The real problem is that you are referencing an item in your source code
that the linker can't find to link in. This could be for a number of
reasons. Wrong case, currupt object files, misspelling, etc.
 
T

Tim Prince

DHOLLINGSWORTH2 said:
The real problem is that you are referencing an item in your source code
that the linker can't find to link in. This could be for a number of
reasons. Wrong case, currupt object files, misspelling, etc.
As a previous reply pointed out, gcc treats .C as denoting c++ code,
regardless of OS or contents of the source file.
 
K

Kelsey Bjarnason

[snips]

The error message was:

"NOTAD.o(.eh_frame+0x11):NOTAD.C: undefined reference to
`__gxx_personality_v0'".

Ahh, that's *very* clear!!!!!

What a clear error message. I am really impressed!

It doesn't really need to be clear. There's really only two ways that I
can see that you'd get the error; one is to screw up the compilation, the
other is if you somehow mucked up your link or environment so badly that
the linker couldn't find libstdc++.

In the first case, it's a user error, trying to compile C code in C++
mode, but without the requisite options - or using the proper compiler
frontend - and in the second, it's liable to also include umpteen other,
more useful diagnostics.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,577
Members
45,052
Latest member
LucyCarper

Latest Threads

Top