delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/05/18/06:54:42

Message-ID: <B0000087279@stargate.astr.lu.lv>
From: "Andris Pavenis" <pavenis AT lanet DOT lv>
To: "Paul H" <paulwebdev AT hotmail DOT com>, djgpp AT delorie DOT com
Date: Tue, 18 May 1999 11:00:35 +0300
MIME-Version: 1.0
Subject: Re: _String.h Error in compiling C++ program
In-reply-to: <19990518045020.62062.qmail@hotmail.com>
X-mailer: Pegasus Mail for Win32 (v3.11)
Reply-To: djgpp AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

Seems You have compiled sources without optimization.
Compile sources with -O2 (recommended) or -O3 and errors should disappear.

Andris


On 17 May 99, at 21:50, Paul H wrote:

> Hello,
> 
> 2 Things:
> 
>   When I compile the following program:
> 
> #include <iostream.h>
> #include <iomanip.h>
> #include <_String.h>
> 
> int main () {
>    String abc;
>    abc = "test";
>    cout << abc;
> 
>    return 0;
> }
> 
> I get the following results with gxx:
> 
> C:\Development\c>gxx -o test.ext test.o
> test.o(.text+0x1f):test.cpp: undefined reference to `String::String(void)'
> test.o(.text+0x30):test.cpp: undefined reference to `String::operator=(char 
> cons
> t *)'

- Raw text -


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