delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/04/29/01:16:40

From: vic <vic9 AT NOSPAMmindless DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Trying to compile C++
Date: Tue, 28 Apr 1998 23:55:42 -0400
Organization: Prodigy Services Corp
Lines: 37
Message-ID: <3546A4BD.A752A564@NOSPAMmindless.com>
Reply-To: vic9 AT NOSPAMmindless DOT com
NNTP-Posting-Host: slip-32-100-152-190.sc.us.ibm.net
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

I am having a lot of trouble getting rhide to compile even the simplest
C++ programs. When I try to compile the following program:

#include <iostream.h>
void print_volume(char name[],double r)
{
 const double pi = 3.14159165;
 double volume;
 volume = pi * r * r * r  ;
 cout  <<name << "       "<<r<< "       " << volume << endl;  }

 int main()
 { cout << "Planet      Radius       Volume" << endl;
  print_volume("Venus",6161.1);
  print_volume("Earth",6379.8);
  print_volume("Mars ",3397.1);
  return 1;
  }

I get the following error message:

¦ Compiling: a:/old/planet.cpp
¦ a:/old/planet.cpp(1) In file included from
a:/old/planet.cpp:1:              _
¦ c:/djgpp/lang/cxx/iostream.h(91) Error: parse error before
`__extension__'   _
¦ c:/djgpp/lang/cxx/iostream.h(208) Error: parse error before
`__extension__'  _
¦ There were some errors

Does anyone have any ideas on what I'm doing wrong.

Vic
Vic9 AT NOSPAMmindless DOT com
remove NOSPAM to email me.


- Raw text -


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