This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Gcc/g++


Chris,

Thanks for the response. Any specific reason to not use gcc to compile
g++ files? One thing I found was that when creating the final binary,
g++ needs to be used. Else it does not link in the correct libraries.
But for just generating .o from a .cpp file, does the use of gcc/g++
make any difference. 

Sampath. 

-----Original Message-----
From: random@bubblescope.net [mailto:random@bubblescope.net] 
Sent: Wednesday, July 13, 2005 9:21 PM
To: Sampath Kumar Herga
Cc: gcc-help@gcc.gnu.org
Subject: Re: Gcc/g++

Sampath Kumar Herga wrote:

> Hi,
>
>I am new to this group and had a very basic question. What is the 
>difference between gcc and g++ when compiling c++ files.
>
Short version: Don't use gcc to compile c++ files unless you know what
you are doing :)

>Also if we have
>a mix of c and c++ files in a project, which is the better compiler to 
>use?
>
>  
>
If you C files are also valid C++ (which there is a good chance there
will be, espically if they are well written), it would be easiest to
compile them all as C++. If you can't / don't want to do this, you'll
have to use the "extern C" notation to mark any functions called from,
or defined in, a C file.

>Please let me know if this is not the correct mailing-list for this 
>question.
>
>  
>
I'm fairly sure it is :)
Chris


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]