www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/07/16/08:54:15

Date: Thu, 16 Jul 1998 15:53:30 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Chia <chia AT top DOT net>
cc: djgpp AT delorie DOT com
Subject: Re: c:/djgpp/tmp\ccwaaaaa... undefined reference to...
In-Reply-To: <6ojfpr$jsk@nnrp3.farm.idt.net>
Message-ID: <Pine.SUN.3.91.980716154730.18013D-100000@is>
MIME-Version: 1.0

On Wed, 15 Jul 1998, Chia wrote:

> When I try to compile, this program gives me "undefined references" to:
> 
>     String::String(char const *)
>     String::operator char const *(void) const
>     String::~String(void)
> 
> I compile with the following command:
> 
>            gcc test.cpp -o test.exe

The FAQ says in sections 8.7 and 8.9 that you should either use gxx 
instead of gcc, or add -lstdcxx -lgpp to your link command line.  You did 
neither.

> I'm sorry if this is in the documentation
> somewhere but i've looked all over for it and not found an answer.

The FAQ has an index at its end.  When you cannot find something, look in 
the index for relevant entries.  For example, in this case, the index has 
this entry:

   * Unresolved externals in C++ programs, use GXX: Section 8.7.

- Raw text -


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