delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/05/14/22:43:19

From: "Paul Cechner" <paul AT ibc DOT com DOT au DOT NOSPAM>
Newsgroups: comp.os.msdos.djgpp
References: <391F1402 DOT 31B7D4A6 AT mtu-net DOT ru> <lm6uhso1th87jm2kvs4d747bb1v9s8fsk9 AT 4ax DOT com> <391F289E DOT CB26D14C AT mtu-net DOT ru> <391F3810 DOT 5932D84E AT mtu-net DOT ru> <391F45A0 DOT 934B2428 AT mtu-net DOT ru>
Subject: Re: C++, complex, etc
Lines: 187
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2615.200
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200
Message-ID: <taKT4.110$%a4.10296@nsw.nnrp.telstra.net>
Date: Mon, 15 May 2000 11:32:08 +0800
NNTP-Posting-Host: 203.24.93.65
X-Complaints-To: abuse AT telstra DOT net
X-Trace: nsw.nnrp.telstra.net 958361369 203.24.93.65 (Mon, 15 May 2000 13:29:29 EST)
NNTP-Posting-Date: Mon, 15 May 2000 13:29:29 EST
Organization: Customer of Telstra Big Pond Direct
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

perhaps you should try
#include <complex>
instead of
#include <complex.h>

> #include <_Complex.h>
I hear that the reason headers are named using the mentioned convention  is
because of the non-case sensitivity of ms-dos based OSs...

perhaps this is just a load of half-remembered half-truths from a half-c++
programmer with not much experience with djgpp :)

--
----------------------
Paul Cechner

Alexei A. Frounze <alex DOT fru AT mtu-net DOT ru> wrote in message
news:391F45A0 DOT 934B2428 AT mtu-net DOT ru...
> I've found a strange solution...
>
> Now my rpogram looks like:
> ------------8<-------------
> #include <iostream.h>
> #include <_Complex.h>
>
> int main(void) {
>   Complex j (0,1);
>
>   cout << "hello world!\n";
>   return 0;
> }
> ------------8<-------------
>
> The source code is no more portable.
>
> Borland C/C++ doesn't have the "_Complex.h" header file and there is no
> class with name "Complex" in "complex.h".
>
> Watcom C/C++ has no the "_Complex.h" header file but have a typedef that
> makes "complex" the same as "Complex".
>
> What's going on?
>
> :((((((((((((((((((((((((((((((((((((((((
> I'm starting to think that:
> - I'm a fool that understands nothing
> - I'm an idiot trying to solve all the problems I ever encounter with
DJGPP
> - I try to use things used pretty seldom by other people, so I have
problems
> - I'm just unlucky
> :((((((((((((((((((((((((((((((((((((((((
>
> Please explain me the purpose of these include/header files from the
> "djgpp/lang/cxx" directory:
>
> ------------8<-------------
> // file name: //
> // complex    //
>
> // Main header for the -*- C++ -*- complex number classes.
> // This file is part of the GNU ANSI C++ Library.
>
> #ifndef __COMPLEX__
> #define __COMPLEX__
>
> #include <std/complext.h>
>
> extern "C++" {
> #define __STD_COMPLEX
>
> // ANSI complex types
> typedef complex<float> float_complex;
> typedef complex<double> double_complex;
> typedef complex<long double> long_double_complex;
> }
>
> #endif
> ------------8<-------------
>
> ------------8<-------------
> // file name: //
> // complex.h  //
>
> // -*- C++ -*- backward compatiblity header.
> // Copyright (C) 1994 Free Software Foundation
>
> #ifndef __COMPLEX_H__
> #include <complex>
> #endif
> ------------8<-------------
>
> ------------8<-------------
> // file name: //
> // _Complex.h //
>
> // This may look like C code, but it is really -*- C++ -*-
>
> #ifndef _Complex_h
> #define _Complex_h
>
> // Use the ANSI complex number template.
> #include <complex>
> typedef complex<double> Complex;
>
> #endif
> ------------8<-------------
>
> Regards,
> Alexei A. Frounze
> -----------------------------------------
> Homepage: http://alexfru.chat.ru
> Mirror:   http://members.xoom.com/alexfru
>
> "Alexei A. Frounze" wrote:
> >
> > I just downloaded the lgp2952b.zip file that contains C++ (sorry, G++ :)
> > library but that doesn't help.
> >
> > --
> > Alexei A. Frounze
> > -----------------------------------------
> > Homepage: http://alexfru.chat.ru
> > Mirror:   http://members.xoom.com/alexfru
> >
> > "Alexei A. Frounze" wrote:
> > >
> > > I tried your suggestions, but the error is still the same.
> > >
> > > Compiler points to the line where I try to define that complex
variable.
> > >
> > > No matter how I define it:
> > >   complex j = complex (0,1);
> > > or
> > >   complex j(0,1);
> > >
> > > I have still the same problem. "complex" is an unknown thing, although
I
> > > have a lot of include files for complex math: complex.h, complex,
> > > complext.h, ...
> > >
> > > bye.
> > > Alexei A. Frounze
> > > -----------------------------------------
> > > Homepage: http://alexfru.chat.ru
> > > Mirror:   http://members.xoom.com/alexfru
> > >
> > > Damian Yerrick wrote:
> > > >
> > > > On Mon, 15 May 2000 01:00:50 +0400, "Alexei A. Frounze"
> > > > <alex DOT fru AT mtu-net DOT ru> wrote:
> > > >
> > > > >Hi!
> > > > >
> > > > >I'm trying to get working the following program:
> > > > >----------------8<----------------
> > > > >#include <iostream.h>
> > > > >#include <complex.h>
> > > >
> > > > Change the above lines to
> > > >
> > > > #include <iostream>
> > > > #include <string>
> > > > using namespace std;
> > > >
> > > > >int main(void) {
> > > > >  complex j = complex(0,1);
> > > >
> > > > How about
> > > >    complex j(0, 1);
> > > >
> > > > >  cout << "hello world!\n";
> > > > >  return 0;
> > > > >}
> > > > >----------------8<----------------
> > > > >
> > > > >I'm trying to compile it using: gcc -c test.cc
> > > > >But I get an Error: "'complex' undeclared (first use in this
function)".
> > > >
> > > > Error on what line?
> > > >
> > > > --
>


- Raw text -


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