help-gplusplus
[Top][All Lists]
Advanced

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

Re: library problem - my own version of C++ using gcc does not link


From: Paul Pluzhnikov
Subject: Re: library problem - my own version of C++ using gcc does not link
Date: Thu, 24 May 2007 11:09:10 -0700
User-agent: Gnus/5.1006 (Gnus v5.10.6) XEmacs/21.4 (Jumbo Shrimp, linux)

Robert Heller <heller@deepsoft.com> 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).

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

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

Cheers,
-- 
In order to understand recursion you must first understand recursion.
Remove /-nsp/ for email.


reply via email to

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