undefined reference to `__gxx_personality_sj0'

S

Sunil Kumar

Hi,
I'm seeing this problem when i try to compile my code.
I did a lot of googling before posting here.

I read that my Library Path may not be set right. but, I get
this error even after setting my library path correctly.

Just to confirm, what should the Library Path include to
solve this error.

Is there any other area that i should be looking into to
solve this.

Thanks in Advance,
Sunil Kumar K
 
T

Tim Prince

Sunil Kumar said:
Hi,
I'm seeing this problem when i try to compile my code.
I did a lot of googling before posting here.

I read that my Library Path may not be set right. but, I get
this error even after setting my library path correctly.

Just to confirm, what should the Library Path include to
solve this error.

Is there any other area that i should be looking into to
solve this.

Thanks in Advance,
Sunil Kumar K
When you include C++ code, you must link against your C++ libraries,
preferably by using the C++ compiler to drive the link. This makes it Off
Topic in c.l.c.
You may be using a C compiler which turns your code over to a C++ compiler
when you use a source file name like xxx.C or xxx.cpp. If you can't figure
out where that happened, you could examine your .o files to find out where
the C++ library is called.
 
C

code_wrong

Sunil Kumar said:
Hi,
I'm seeing this problem when i try to compile my code.
I did a lot of googling before posting here.

I read that my Library Path may not be set right. but, I get
this error even after setting my library path correctly.

Just to confirm, what should the Library Path include to
solve this error.

Is there any other area that i should be looking into to
solve this.

I use dev-c++ with gcc on windows xp
and when I try to compile a c soure
where the filename has a capitalised
extension (eg filename.C)
I get a similar undefined reference
__gxx_personality_??

When I change the extension to lowercase
all is well ...strange but true ...
 
A

anonymous

code_wrong said:
I use dev-c++ with gcc on windows xp
and when I try to compile a c soure
where the filename has a capitalised
extension (eg filename.C)
I get a similar undefined reference
__gxx_personality_??

When I change the extension to lowercase
all is well ...strange but true ...

Yes, this happened to me also, on DJGPP. I was getting message like

e:/djgpp/tmp/ccwOnjlv.o(.eh_frame+0x11):pTR.C: undefined reference to
`___gxx_personality_v0'
collect2: ld returned 1 exit status

The problem is the name of the program: PTR.C (uppercase extension)
 
M

Michael Mair

Hi there,

I use dev-c++ with gcc on windows xp
and when I try to compile a c soure
where the filename has a capitalised
extension (eg filename.C)
I get a similar undefined reference
__gxx_personality_??

When I change the extension to lowercase
all is well ...strange but true ...

Not so strange: If you do not specify the language,
gcc (and djgpp, for that matter) try to determine the
language from the file extension.
..C is not considered to be a file extension for C source
by gcc.
C source often does not lead to successfully compiled
and linked programs when passed to a C++ compiler,
for example...
Read the compiler documentation.

Tell gcc that you want C89 (with or w/o amendment),
gnu89 or the C99 subset gcc is able to handle by now
(or the respective gnu99 version), then you are fine
with any extension.


Cheers,
Michael
 
C

code_wrong

Michael Mair said:
Hi there,



Not so strange: If you do not specify the language,
gcc (and djgpp, for that matter) try to determine the
language from the file extension.
.C is not considered to be a file extension for C source
by gcc.
C source often does not lead to successfully compiled
and linked programs when passed to a C++ compiler,
for example...
Read the compiler documentation.

Tell gcc that you want C89 (with or w/o amendment),
gnu89 or the C99 subset gcc is able to handle by now
(or the respective gnu99 version), then you are fine
with any extension.

aha Interesting .. thanks for info
 

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

Forum statistics

Threads
474,146
Messages
2,570,831
Members
47,374
Latest member
anuragag27

Latest Threads

Top