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: Robert Heller
Subject: Re: library problem - my own version of C++ using gcc does not link
Date: Thu, 24 May 2007 23:18:59 +0200

At Thu, 24 May 2007 20:07:13 +0200 Bernd Strieder 
<strieder@informatik.uni-kl.de> wrote:

> 
> Hello,
> 
> Robert Heller wrote:
> 
> > At Thu, 24 May 2007 15:08:26 GMT Jim Anderson <ezjab@ieee.org> wrote:
> 
> > 
> > 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++
> 
> That is usually not enough, the linker might need special options, there
> are linking passes special to C++, special startup code might be
> necessary and more, all differing between platforms and compiler
> releases. Just use g++, it has been working the same way for a long
> time, and almost everywhere.

True, my point is that with some effort, it is possible to link a C++
program with gcc.  OTOH, it is NOT a recomended practice...

> 
>        

-- 
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]