delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/11/13/14:00:20

Message-Id: <199811081959.TAA16767@remus.clara.net>
From: "Arthur" <arfa AT clara DOT net>
To: <djgpp AT delorie DOT com>
Subject: RE: What`s wrong with this program? PLEASE HELP!
Date: Sun, 8 Nov 1998 19:59:32 -0000
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook 8.5, Build 4.71.2173.0
Importance: Normal
In-Reply-To: <364687f9.37182612@news.3web.net>
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3
Reply-To: djgpp AT delorie DOT com

> Total C++ newbie here. I just started studying C++ after getting bored
> with Visual Basic, but DJGPP is choking severely on the incredibly
> simple program below.

[snip]

> #include <iostream.h>
> int main()
> {
>    cout << "Hello World!\n";
>    return 0;
> }
>

Yep, this should compile.

> In file included from c:/djgpp/lang/cxx/iostream.h:31,
>                  from C:\\temp\\test.cc:1:
> c:/djgpp/lang/cxx/streambuf.h:393: `__null' was not declared in this
> scope
> c:/djgpp/lang/cxx/streambuf.h: In method `int
> streambuf::have_backup()':
> c:/djgpp/lang/cxx/streambuf.h:329: `__null' undeclared (first use this
> function)
>
> c:/djgpp/lang/cxx/streambuf.h:329: (Each undeclared identifier is
> reported only
> once
> c:/djgpp/lang/cxx/streambuf.h:329: for each function it appears in.)
> c:/djgpp/lang/cxx/streambuf.h: In method `int
> streambuf::have_markers()':
> c:/djgpp/lang/cxx/streambuf.h:330: `__null' undeclared (first use this
> function)
>
> c:/djgpp/lang/cxx/streambuf.h: In method `void streambuf::allocbuf()':
> c:/djgpp/lang/cxx/streambuf.h:374: `__null' undeclared (first use this
> function)
>
> c:/djgpp/lang/cxx/iostream.h: At top level:
> In file included from C:\\temp\\shite.cc:1:
> c:/djgpp/lang/cxx/iostream.h:50: `__null' was not declared in this
> scope
> c:/djgpp/lang/cxx/iostream.h:91: parse error before `__extension__'
> c:/djgpp/lang/cxx/iostream.h:123: `__null' was not declared in this
> scope
> c:/djgpp/lang/cxx/iostream.h:208: parse error before `__extension__'
> c:/djgpp/lang/cxx/iostream.h:230: `__null' was not declared in this
> scope

What is the command line you're using to compile this program? I bet it's
something like "gcc hello.cpp -o hello.exe". Try this instead: "gxx
hello.cpp -o hello.exe" or "gcc hello.cpp -o hello.exe -lstdcxx". gcc is the
standard C compiler, and you need to link with the C++ library, or use gxx
instead (both do effectively the same thing).

James Arthur
jaa AT arfa DOT clara DOT net
ICQ#15054819


- Raw text -


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