Mail Archives: djgpp/1996/06/17/12:01:51
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 -