www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2002/10/27/15:46:37

From: "Peter" <peter_data2002 AT yahoo DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Compilation Error
Lines: 47
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4807.1700
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4807.1700
Message-ID: <S2Yu9.29661$Mb3.1242994@bgtnsc04-news.ops.worldnet.att.net>
Date: Sun, 27 Oct 2002 20:31:46 GMT
NNTP-Posting-Host: 12.77.27.140
X-Complaints-To: abuse AT worldnet DOT att DOT net
X-Trace: bgtnsc04-news.ops.worldnet.att.net 1035750706 12.77.27.140 (Sun, 27 Oct 2002 20:31:46 GMT)
NNTP-Posting-Date: Sun, 27 Oct 2002 20:31:46 GMT
Organization: AT&T Worldnet
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Hi;

I have installed the Djgpp gnu in C:\djgpp drive as indicated in the
installation instruction. I copied the unzip32.exe and the zip files into
C:\djgpp directory and then I unzip the files using unzip32. Then I created
a bat file with following statements:
set DJGPP=C:\DJGPP\DJGPP.ENV
set PATH=C:\DJGPP\BIN;%PATH%

In order to test the installation I created a test.cpp file in c:\djgpp. To
compile the file I executed the bat file from command prompt and then I
compiled the file:

c:\djgpp\gcc test.cpp

I got following compilation error:

test.cpp: In function `int main()':
test.cpp:9: `cout' undeclared (first use this function)
test.cpp:9: (Each undeclared identifier is reported only once for each
function
   it appears in.)

The content of the test.cpp is:

#include<iostream>

int main()
{
    char *str1 =new char(100);
    char *str2=str1;

    cout <<int(str1) << "address of  str2 is "  <<int(str2)<<"\n";
    *str2++ = 'T';
    *str2++='E';
    cout<<"value of str1 is "<<str1<<"\n";
    return 1;
}


iostrem is located in "c:\djgpp\lang\cxx\3.2\"

I would appreciate help on resolving the issue.

Thanks


- Raw text -


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