At Thu, 24 May 2007 11:09:10 -0700 Paul Pluzhnikov <[EMAIL PROTECTED]> wrote:

> 
> Robert Heller <[EMAIL PROTECTED]> writes:
> 
> > gcc can link C++ code, but you need to give it a 'hint' that you are in
> > fact linking C++ code, usually by including the -l option(s) that g++
> > would normally add:
> >
> > gcc -g -o test test.o Product.o DerivedProduct.o Creator.o \
> >     DerivedCreator.o -lstdc++ -lc++
> 
> This (IMHO) is a very bad advice(TM).

Very true.  My point is that g++ adds some additional options to the
link step that are specific to C++ -- one should *always* use g++ to
link C++ code (compiled by g++).

> 
> The link line above is incorrect for all versions of gcc I am
> aware of.

Yeah, probably it is.  It is NOT something I have done in recent times.

> 
> Correct link line may (and does) change with different versions of
> g++, so *never* do this. Always use 'g++' to link C++ code.
> 
> Cheers,

-- 
Robert Heller             -- 978-544-6933
Deepwoods Software        -- Linux Installation and Administration
http://www.deepsoft.com/  -- Web Hosting, with CGI and Database
[EMAIL PROTECTED]       -- Contract Programming: C/C++, Tcl/Tk
                                                                                
                   
_______________________________________________
help-gplusplus mailing list
help-gplusplus@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gplusplus

Reply via email to