Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora 17/18 > Using Fedora
FedoraForum Search

Forgot Password? Join Us!

Using Fedora General support for current versions. Ask questions about Fedora and it's software that do not belong in any other forum.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 16th July 2006, 03:12 AM
zomgitszan Offline
Registered User
 
Join Date: Jul 2006
Posts: 2
Exclamation error compiling with gcc

i just setup fc4 on my laptop and encountered a weird error while compiling a simple c++ file i get this error

Code:
zan /tmp/ccCQf955.o(.eh_frame+0x11): undefined reference to `__gxx_personality_v0'
zan collect2: ld returned 1 exit status
now that comes from both using gcc /path/to/file/test.cpp and gcc /path/to/file/test.cpp -o test
i change the file to a .c file and compiles fine no errors i compile the same cpp file with g++ and it is fine the code is below. is there somthing i need todo with some settings to get gcc to compile a c++ file or is this a bug?

Code:
#include <stdio.h>
int main(void)
{
	printf("lalalala");
	return 0;

}
my ver of gcc is
gcc version 4.0.0 20050519 (Red Hat 4.0.0-8)
and again this is a simple app, but i did it just to see if i would encounter a problem and not 10,000 lines later
thanks
rick
Reply With Quote
  #2  
Old 17th July 2006, 10:35 PM
tashirosgt Offline
Registered User
 
Join Date: Aug 2004
Posts: 3,855
As you found out, g++ is used to compile C++ programs and gcc is used for C programs. I think these commands invoke different preprocessors. What I find interesting about your results is that they apparently pay attention to the file extension (*.c vs *.cpp). I think if you put some functions in the test program that are part of C++ and not part of C, you will find that only g++ compiles it.
__________________
"Never let the task you are trying to accomplish distract you from the study of computers."
Reply With Quote
  #3  
Old 18th July 2006, 01:13 AM
zomgitszan Offline
Registered User
 
Join Date: Jul 2006
Posts: 2
thanks for that info, i was lead to belive that gcc would compile both c and c++. anyway thanks for the reply
Reply With Quote
Reply

Tags
compiling, error, gcc

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Error Compiling skateaction Using Fedora 4 17th December 2008 07:20 PM
error when compiling app bowens44 Using Fedora 3 20th June 2007 12:06 PM
Error with compiling... MrVitale Using Fedora 4 22nd March 2006 03:56 PM
Compiling error... i think Saint Mike Using Fedora 2 10th July 2005 06:30 AM
Error in compiling! Please, help me! Calabuig Using Fedora 4 11th July 2004 06:02 AM


Current GMT-time: 15:50 (Wednesday, 22-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat