help-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: what's the differnece between gcc and g++?


From: Robert Heller
Subject: Re: what's the differnece between gcc and g++?
Date: Mon, 04 Sep 2006 15:29:19 +0200

At 4 Sep 2006 00:19:35 -0700 "Maxim Yegorushkin" <maxim.yegorushkin@gmail.com> 
wrote:

> 
> Rolf Magnus wrote:
> 
> []
> 
> > But linking is another story. When linking the result generated from C++
> > code, you need different linker options than for C code, and the linker
> > can't find out the language that the object code was compiled from, so you
> > have to tell it explicitly. When you use gcc for linking, it will pass the
> > options relevant for C code to the linker (unless you explicitly specify
> > the language), while g++ will link it as C++ code.
> 
> Does the linker care about the language object files were generated
> from? From what I gather from info ld the only c++-specific option
> which may affect the (binary) output of ld is -Ur. Am I missing
> something?

g++ adds -lstdc++ (at least) to the link -- that is, c++ has additional
run time libs over plain C.

> 
>                                                                               
>                   

-- 
Robert Heller             -- 978-544-6933
Deepwoods Software        -- Linux Installation and Administration
http://www.deepsoft.com/  -- Web Hosting, with CGI and Database
heller@deepsoft.com       -- Contract Programming: C/C++, Tcl/Tk
            


reply via email to

[Prev in Thread] Current Thread [Next in Thread]