473,725 Members | 1,980 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

undefined reference to '__gxx_personal ity_v0'

I have a small program, test.c. It runs OK. This is on Linux (kernel
2.6.8.1, GCC 3.4.1).

I decided to convert it to C++ before expanding it to a larger program. I
changed the filename to test.cpp and added

extern "C" {
}

around main and all the non-static subroutines. It compiles OK, but when I
link it, it says:

test.o (.eh_frame+0x11 ): undefined reference to '__gxx_personal ity_v0'

My program makes no reference to __gxx_personali ty_v0.

What do I need to do to get this program to link as a C++ program?

Thanks,
Allie
Dec 9 '05 #1
4 75434
Albert Oppenheimer wrote:
I have a small program, test.c. It runs OK. This is on Linux (kernel
2.6.8.1, GCC 3.4.1).

I decided to convert it to C++ before expanding it to a larger program. I
changed the filename to test.cpp and added

extern "C" {
}

around main and all the non-static subroutines. It compiles OK, but when I
link it, it says:

test.o (.eh_frame+0x11 ): undefined reference to '__gxx_personal ity_v0'

My program makes no reference to __gxx_personali ty_v0.

What do I need to do to get this program to link as a C++ program?


This is platform specific, but try compiling (and linking) with "g++"
rather than "gcc." Or, when you link, make sure you specify the C++
library (which gcc does automatically if you use g++ as your command
line rather than gcc).

If you have further questions, you'll get better help asking in a
platform-specific newsgroup.

Best regards,

Tom

Dec 9 '05 #2
Albert Oppenheimer wrote:
I have a small program, test.c. It runs OK. This is on Linux (kernel
2.6.8.1, GCC 3.4.1).

I decided to convert it to C++ before expanding it to a larger program. I
changed the filename to test.cpp and added

extern "C" {
}

around main and all the non-static subroutines. It compiles OK, but when I
link it, it says:

test.o (.eh_frame+0x11 ): undefined reference to '__gxx_personal ity_v0'

My program makes no reference to __gxx_personali ty_v0.

What do I need to do to get this program to link as a C++ program?

Thanks,
Allie


The __gxx part indicates that this is a g++-specific implementation
issue. The .eh_frame probably indicates that it is concerned with
exception handling, code for which may be automatically inserted for
C++ programs (but not for C). If so, you could disable exceptions with
a compiler flag or link in the proper symbols from a library that came
with your compiler (perhaps libstdc++?), which may not get pulled in
with your current compiler flags. As the other respondent said, any
follow-up should be directed to a GNU newsgroup see the FAQ for some
alternate newsgroups:

http://www.parashift.com/c++-faq-lit...t.html#faq-5.9

Cheers! --M

Dec 9 '05 #3
Hello Albert,

Albert Oppenheimer wrote:
I have a small program, test.c. It runs OK. This is on Linux (kernel
2.6.8.1, GCC 3.4.1).

I decided to convert it to C++ before expanding it to a larger program. I
changed the filename to test.cpp and added
This already enough to make it a C++ program. GCC will automatically compile
it as a c++ program because of the cpp extension.
extern "C" {
}

around main and all the non-static subroutines. It compiles OK, but when
I link it, it says:
It's not necessary. Remove the extern "C" stuff and try again, it should
compile and link fine.
You need the extern "C" only if you are calling a C function, like printf()
from a C++ module. If you would like to know more, google for "name
mangling" and you should find good explanations for it and what it's for.
test.o (.eh_frame+0x11 ): undefined reference to '__gxx_personal ity_v0'

My program makes no reference to __gxx_personali ty_v0.

What do I need to do to get this program to link as a C++ program?

Thanks,
Allie


hth Peter

Dec 9 '05 #4
Thanks, it linked and ran fine after I used g++.
Dec 9 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
13121
by: RU | last post by:
Hi, I am working on a porting project to port C/C++ application from unixware C++, AT&T Standard components to g++ with STL on Linux. This application has been working properly on Unixware/C++/AT&T componets environment. I have been able to compile all modules after making necessary changes in LINUX/gcc/STL environment. We have two templates defined XList and XMap.
1
11261
by: Stu | last post by:
I am trying to build the xerces shared library with 2.3.0 version of their source code on an AIX 5.1 32 bit machine with the following version of the g++ compiler /usr/local/bin/g++ -v Reading specs from /usr/local/lib/gcc-lib/powerpc-ibm-aix5.1.0.0/3.3.1/specs Configured with: ../gcc-3.3.1/configure --disable-nls Thread model: aix gcc version 3.3.1
1
3149
by: Codemutant | last post by:
**** Post for FREE via your newsreader at post.usenet.com **** I just cannot find what is undefined in this code.
1
9611
by: Foolster41 | last post by:
I'm rather new to C++ programing. I'm using the dev-C++ program on a windows XP OS. I'm trying to compile the code for a multi user dungeon (MUD) called circle-mud. When I compile I get the following errors: ---- Compiler: Default compiler Building Makefile: "C:\EvoMud\circle-3.1\src\Makefile.win" Executing make...
1
31156
by: Dom | last post by:
I'm new to c++. Just started learning it 24 hours ago. Am running into a compile problem. Please, no one waste the effort telling me to google it. I've been researching it for quite a while with no joy. I got dev-c++ and a bit of winsock sample code. I've done nothing out of the ordinary. I could only assume that anyone else that downloaded this software and attempted this would meet with the same result. The problem lies with either the...
3
789
by: Michael Sgier | last post by:
Hi i get thousands of messages like below. How shall i resolve that? Thanks Mcihael Release/src/Utility/RawImage.o: In function `CMaskImage::CMaskImage(int, int, char const*)': RawImage.cpp:(.text+0x15dc): undefined reference to `popen(PFS*, char const*)'
45
4848
by: VK | last post by:
(see the post by ASM in the original thread; can be seen at <http://groups.google.com/group/comp.lang.javascript/browse_frm/thread/3716384d8bfa1b0b> as an option) As that is not in relevance to "new Array() vs " question or to the array performance, I dared to move it to a new thread. Gecko takes undefined value strictly as per Book 4, Chapter 3, Song 9 of Books of ECMA :-)
3
11597
by: prakash.mirji | last post by:
Hello, I am getting below mention linker error when I tried to link my class test.C I use below command to compile test.C /usr/bin/g++ -g -fpic -fvisibility=default -D_POSIX_SOURCE -DTRACING - D__EXTENSIONS__ -D__RWCOMPILER_H__ -D_REENTRANT -D_RWCONFIG=8s - D_RWCONFIG_12d -D_RWSTDDEBUG -DRWDEBUG -o test1 test1.o -L/lib -
1
10915
by: taiyang902 | last post by:
i program under linux ,and using kdevelop c/c++. the code follow, #ifdef HAVE_CONFIG_H #include <config.h> #endif #include <iostream> #include <cstdlib> using namespace std;
0
8888
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9257
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9174
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6702
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6011
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4517
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4782
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3221
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2157
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.