www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/06/17/12:01:51

Xref: news2.mv.net comp.os.msdos.djgpp:5088
From: broeker AT PROBLEM_WITH_INEWS_DOMAIN_FILE (Hans-Bernhard Broeker)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Complex class
Date: 17 Jun 1996 13:38:54 GMT
Organization: RWTH -Aachen / Rechnerbetrieb Informatik
Lines: 31
Message-ID: <4q3n5e$ede@news.rwth-aachen.de>
References: <4prjme$g3l AT hearst DOT cac DOT psu DOT edu>
NNTP-Posting-Host: axpcl6.physik.rwth-aachen.de
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Mike LaPaglia (mcl134 AT psu DOT edu) wrote:
> Has anyone had any luck using the Complex class in v2? 

> I have included the proper .h file according to the faq.
> #include <_complex.h>
> the program compiles fine but the linker cannot find the complex 
> class definitions in the library.

> I looked in libgpp.a with 'ar' and there is not reference to any 
> Complex class functions, as there are for other functions that 
> are available.  I had no trouble with the Complex class in v1.x.

> Also, I noticed that there was no complex.cc files in the lgpp272s.zip.

Please note that there has been at least one important change in the
handling of the 'complex' type in C++ from DJGPP v1.x to v2 (in fact,
the change is in libg++). As of libg++ 2.7.2, there is now a
*template* complex<type>, and the class Complex is then defined as
'complex<double>' (have a look into _complex.h, and you'll see). Among
other things, this means that there won't be a 'complex.cc' library
source file, and also no predefined functions in libgpp.a.  The code
is generated at compile time, and you'll have to make your way through
all that template instantiation stuff to get it right. I once tried to
bring oracle to DOS, and this was a major problem: oracle was written
for libg++-2.6.*, and this caused a compilation error for each and
every variable declared as 'class Complex foo', because Complex isn't
just a class anymore. As you can see, C++ is still floating around at
large velocities... (another point: I might have reversed the meanings
of 'complex' and 'Complex' above).

Hans-Bernhard Broeker (Aachen, Germany)

- Raw text -


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