delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/10/20/10:25:37

From: "Kevin O'Dwyer" <kevin DOT odwyer AT latticesemi DOT com>
To: "'John Meyer'" <john_meyer AT geocities DOT com>
Cc: <djgpp AT delorie DOT com>
Subject: RE: Help!
Date: Fri, 20 Oct 2000 08:33:09 -0500
Message-Id: <001101c03a9a$49fa5110$600917ac@ausnt010.latticesemi.com>
Mime-Version: 1.0
X-Priority: 3 (Normal)
X-Msmail-Priority: Normal
X-Mailer: Microsoft Outlook 8.5, Build 4.71.2173.0
Importance: Normal
X-Mimeole: Produced By Microsoft MimeOLE V4.72.2106.4
In-Reply-To: <20001020.1573300@c604508-b.pueblo1.co.home.com>
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

Hi, John.  Thanks very much for replying.

I am doing some php3/MySQL stuff here.  php3 uses a lot of C language, so I
figured just learn the whole C language.  Got the C++ book by Stephen Davis,
and tried to install the GNU C++ for Windows/NT. (as if the dad of three
pre-teens can crash-learn anything!)

As a function check, I tried to compile this simple code below, also taken
from the CD ROM included with the book.  But it stumbles over the included
file iostream.h.  The compiler finds errors in iostream.h.
Downloading/installing GNU C++ from the DJGPP website yields essentially the
same results - compiler goes on about how screwed up isotream.h is.

Compiling the code on a UNIX platform presents no problems, only Win/NT.  I
suspect that somewhere in the code for iostream.h, maybe some characters
(seen or unseen) might be getting garbled, so I've included the first few
lines of the included file and the first few lines of compile errors below.
Being a serious beginner at C/C++, I don't understand what's wrong with
having an ampersand in a statement where it is, especially not in one of
these '.h ' files, etc.

As I page through the delorie web site, it seems that lots of folks are
having problems with this file.  The only thing that I can think of is that
maybe I used the wrong version of unzip.  Maybe if I use pkunzip versus
WinZip, it might be better.  I followed the instructions twice, enabling the
right things, etc. But on the face of what I've got, I'm stumped now.  We've
got some test engineers, and they use C/C++ for component test programs.
They are stumped, too.

The first part of the results are included below.

Thanks for your attention and time, Kevin O'Dwyer

Lattice Austin Quality
(512) 381-6535
5812 Trade Center Drive, Suite 100
Austin, TX 78744-3426
FAX: (512) 381-6698
kevin DOT odwyer AT latticesemi DOT com




"HELLO WORLD" EXAMPLE FILE:
==========================

//
//  Conversion - convert temperature from Celsius
//		         degree units into Fahrenheit degree
//               units:
//      Fahrenheit = Celsius  * (212 - 32)/100 + 32
//
#include <stdio.h>
#include <iostream.h>
int main(int nNumberofArgs, char* pszArgs[])
{
    // enter the temperature in Celsius
    int nCelsius;
    cout << "Enter the temperature in Celsius:";
    cin  >> nCelsius;

    // calculate conversion factor for Celsius
    // to Fahrenheit
    int nFactor;
    nFactor = 212 - 32;

    // use conversion factor to convert Celsius
    // into Fahrenheit values
    int nFahrenheit;
    nFahrenheit = nFactor * nCelsius/100 + 32;

    // output the results
    cout << "Fahrenheit value is:";
    cout << nFahrenheit;

    return 0;
}


FIRST FEW LINES OF iostream.h:
=========================

#ifndef _IOSTREAM_H
#ifdef __GNUG__
#pragma interface
#endif
#define _IOSTREAM_H



extern "C++" {
class istream; class ostream;

typedef ios& (*__manip)(ios&);
typedef istream& (*__imanip)(istream&);
typedef ostream& (*__omanip)(ostream&);

extern istream& ws(istream& ins);
extern ostream& flush(ostream& outs);
extern ostream& endl(ostream& outs);
extern ostream& ends(ostream& outs);

etc, etc, etc.......


FIRST FEW LINES OF COMPILE ERRORS:
================================
c:/djgpp/lang/cxx/iostream.h(35)Error: syntax error before `&'
c:/djgpp/lang/cxx/iostream.h(46)Error: parse error before `{'
c:/djgpp/lang/cxx/iostream.h(51)Error: parse error before `*'
etc, etc, etc....





-----Original Message-----
From: John Meyer [mailto:john_meyer AT geocities DOT com]
Sent: Thursday, October 19, 2000 8:58 PM
To: kevin DOT odwyer AT latticesemi DOT com
Cc: djgpp AT delorie DOT com; Skahfee AT mail DOT com
Subject: RE: Help!


What exactly is the problem?


- Raw text -


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