www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/05/06/05:00:21

Date: Wed, 6 May 1998 10:59:50 +0200
From: laurentc AT casimir DOT stortek DOT com (CAZARD )
Message-Id: <9805060859.AA12565@casimir.stortek.com>
To: djgpp AT delorie DOT com
Subject: Re: ld and C++ String class

Thanks for your help John but i have tried this and I've got the same results
I have tried to compile the program with the version 2.7.1 with gxx and it has worked fine. Have you tried to compile the small source i have send with version 2.8 ?

Thanks again
---- Début du message inclus ----

From dj-admin AT delorie DOT com Wed May  6 01:56 MET 1998
From: "John M. Aldrich" <fighteer AT cs DOT com>
Subject: Re: ld and C++ String class
Date: Tue, 05 May 1998 18:46:36 -0400
Nntp-Posting-Host: ppp138.cs.net
Mime-Version: 1.0
Content-Transfer-Encoding: 7bit
To: djgpp AT delorie DOT com
Dj-Gateway: from newsgroup comp.os.msdos.djgpp
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com
Precedence: bulk

Cazard, Laurent J wrote:
> 
> I've got this result
> C:\projet>gpp -v -lgpp -lstdcxx stringe.cc

1) Put the libraries _after_ the source/object files on the command
line.  DJGPP uses a one-pass linker; it doesn't know to look for that
code until it sees the library.
2) Your use of '-lstdcxx' is redundant anyway, because gpp adds it
automatically.  The problem is that the String class is defined in
libgpp.a, which is not getting linked properly.

The correct command line is thus:

    gpp -o stringe.exe stringe.cc -lgpp

See chapters 8.7, 8.8, and 8.9 of the DJGPP FAQ for more information.

hth!

-- 
---------------------------------------------------------------------
|      John M. Aldrich       | "Autocracy is based on the assumption|
|       aka Fighteer I       | that one man is wiser than a million |
|   mailto:fighteer AT cs DOT com   | men.  Let's play that over again,    |
| http://www.cs.com/fighteer | too.  Who decides?"   - Lazarus Long |
---------------------------------------------------------------------


---- Fin du message inclus ----

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019