www.digitalmars.com         C & C++   DMDScript  

c++ - does dm support c++ standard header names?

reply "Richard Johnson" <rich REMOVETHISBITnorthernsky.uklinux.net> writes:
Hi,

I've just downloaded digital mars and have started to play around with it.
So far I like what I see except that it seems that I have to use the
old-style way of including headers. So, for example:

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

compiles whereas:

#include <iostream>
using namespace std;
int main() {
    cout << "hello\n";
    return 0;
}

does not. The compiler says 'unable to open input file iostream'. I'm
wondering if dm simply does not support the newer way of including files or
if the problem lies in my setup. I'm using dm version 8.26n on windows 2000.

Thanks in advance,

Richard.
Feb 13 2002
next sibling parent reply Jan Knepper <jan smartsoft.cc> writes:
Richard Johnson wrote:

 Hi,

 I've just downloaded digital mars and have started to play around with it.
 So far I like what I see except that it seems that I have to use the
 old-style way of including headers. So, for example:

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

 compiles whereas:

 #include <iostream>
 using namespace std;
 int main() {
     cout << "hello\n";
     return 0;
 }

 does not. The compiler says 'unable to open input file iostream'.
That's because that file does not yet exist in the package!
 I'm
 wondering if dm simply does not support the newer way of including files or
 if the problem lies in my setup. I'm using dm version 8.26n on windows 2000.
No, as far as I know the newer files are missing... Jan
Feb 13 2002
parent reply "Richard Johnson" <rich REMOVETHISBITnorthernsky.uklinux.net> writes:
"Jan Knepper" <jan smartsoft.cc> wrote in message
news:3C6AFE12.22D13C70 smartsoft.cc...
 Richard Johnson wrote:

 I've just downloaded digital mars and have started to play around with
it.
 So far I like what I see except that it seems that I have to use the
 old-style way of including headers.

 #include <iostream>
 using namespace std;
 int main() {
     cout << "hello\n";
     return 0;
 }

 does not compile. The compiler says 'unable to open input file
iostream'.
 That's because that file does not yet exist in the package!
 No, as far as I know the newer files are missing...
Surely it's the same file? As I understand it you can include iostream by typing "#include <iostream.h>" but the proper way of doing it is by typing "#include <iostream>". Whichever method you use you're still talking about the same header file aren't you?? Richard.
Feb 14 2002
parent reply Jan Knepper <jan smartsoft.cc> writes:
 Surely it's the same file? As I understand it you can include iostream by
 typing "#include <iostream.h>" but the proper way of doing it is by typing
 "#include <iostream>".  Whichever method you use you're still talking about
 the same header file aren't you??
AFAIK yes. iostream could just #include <iostream.h>... Jan
Feb 14 2002
parent "Richard Johnson" <rich REMOVETHISBITnorthernsky.uklinux.net> writes:
"Jan Knepper" <jan smartsoft.cc> wrote in message
news:3C6BE6AF.A6092700 smartsoft.cc...
 Surely it's the same file? As I understand it you can include iostream
by
 typing "#include <iostream.h>" but the proper way of doing it is by
typing
 "#include <iostream>".  Whichever method you use you're still talking
about
 the same header file aren't you??
AFAIK yes. iostream could just #include <iostream.h>... Jan
Actually, I've just created an 'iostream' that does just that ;o) However, I've just realised this still doesn't give me the 'std' namespace - but that's too much like hardwork to sort out right now so maybe I'll forget about namespaces for now... Richard.
Feb 14 2002
prev sibling parent reply "David Rasmussen" <pinkfloydhomer yahoo.com> writes:
"Richard Johnson" <rich REMOVETHISBITnorthernsky.uklinux.net> skrev i en
meddelelse news:a4dji3$240h$1 digitaldaemon.com...
 does not. The compiler says 'unable to open input file iostream'. I'm
 wondering if dm simply does not support the newer way of including files
or
 if the problem lies in my setup. I'm using dm version 8.26n on windows
2000.
 Thanks in advance,

 Richard.
The compiler doesn't seem to support namespaces either?! #include <iostream> int main() { std::cout << "Hello World!" << std::endl; return 0; } This produces errors, when compiled, even if iostream.h is used instead... Can this be true?? I thought this compiler was good! /David
Feb 14 2002
next sibling parent reply Jan Knepper <jan smartsoft.cc> writes:
Yes, it can be true because of the fact that cout is NOT defined in the std
namespace.

Jan



David Rasmussen wrote:

 "Richard Johnson" <rich REMOVETHISBITnorthernsky.uklinux.net> skrev i en
 meddelelse news:a4dji3$240h$1 digitaldaemon.com...
 does not. The compiler says 'unable to open input file iostream'. I'm
 wondering if dm simply does not support the newer way of including files
or
 if the problem lies in my setup. I'm using dm version 8.26n on windows
2000.
 Thanks in advance,

 Richard.
The compiler doesn't seem to support namespaces either?! #include <iostream> int main() { std::cout << "Hello World!" << std::endl; return 0; } This produces errors, when compiled, even if iostream.h is used instead... Can this be true?? I thought this compiler was good! /David
Feb 14 2002
next sibling parent reply "Richard Johnson" <rich REMOVETHISBITnorthernsky.uklinux.net> writes:
"Jan Knepper" <jan smartsoft.cc> wrote in message
news:3C6C4926.1CAD8B4D smartsoft.cc...
 Yes, it can be true because of the fact that cout is NOT defined in the
std
 namespace.

 Jan
It's supposed to be defined in the std namespace though isn't it? Richard.
Feb 15 2002
parent Jan Knepper <jan smartsoft.cc> writes:
In the latest standard it is I think.



Richard Johnson wrote:

 "Jan Knepper" <jan smartsoft.cc> wrote in message
 news:3C6C4926.1CAD8B4D smartsoft.cc...
 Yes, it can be true because of the fact that cout is NOT defined in the
std
 namespace.

 Jan
It's supposed to be defined in the std namespace though isn't it? Richard.
Feb 15 2002
prev sibling parent reply "David Rasmussen" <pinkfloydhomer yahoo.com> writes:
"Jan Knepper" <jan smartsoft.cc> skrev i en meddelelse
news:3C6C4926.1CAD8B4D smartsoft.cc...
 Yes, it can be true because of the fact that cout is NOT defined in the
std
 namespace.

 Jan
So this compiler is not ANSI/ISO compliant in the least bit? According to ANSI/ISO compliance, cout is defined int the std namespace. In practice, this means that most modern, compliant code cannot be compiled with this compiler. That's a shame. /David
Feb 15 2002
parent reply Jan Knepper <jan smartsoft.cc> writes:
It is not completely compliant YET with the latest ANSI/ISO standards...

Jan



David Rasmussen wrote:

 "Jan Knepper" <jan smartsoft.cc> skrev i en meddelelse
 news:3C6C4926.1CAD8B4D smartsoft.cc...
 Yes, it can be true because of the fact that cout is NOT defined in the
std
 namespace.

 Jan
So this compiler is not ANSI/ISO compliant in the least bit? According to ANSI/ISO compliance, cout is defined int the std namespace. In practice, this means that most modern, compliant code cannot be compiled with this compiler. That's a shame. /David
Feb 15 2002
parent "David Rasmussen" <pinkfloydhomer yahoo.com> writes:
Which is 4 years old :)

"Jan Knepper" <jan smartsoft.cc> skrev i en meddelelse
news:3C6D2143.6ECFC52B smartsoft.cc...
 It is not completely compliant YET with the latest ANSI/ISO standards...

 Jan



 David Rasmussen wrote:

 "Jan Knepper" <jan smartsoft.cc> skrev i en meddelelse
 news:3C6C4926.1CAD8B4D smartsoft.cc...
 Yes, it can be true because of the fact that cout is NOT defined in
the
 std
 namespace.

 Jan
So this compiler is not ANSI/ISO compliant in the least bit? According
to
 ANSI/ISO compliance, cout is defined int the std namespace. In practice,
 this means that most modern, compliant code cannot be compiled with this
 compiler. That's a shame.

 /David
Feb 16 2002
prev sibling parent reply "Richard Johnson" <rich REMOVETHISBITnorthernsky.uklinux.net> writes:
"David Rasmussen" <pinkfloydhomer yahoo.com> wrote in message
news:a4hg6h$th4$1 digitaldaemon.com...
 The compiler doesn't seem to support namespaces either?!

 #include <iostream>

 int main()
 {
     std::cout << "Hello World!" << std::endl;

     return 0;
 }

 This produces errors, when compiled, even if iostream.h is used instead...

 Can this be true?? I thought this compiler was good!

 /David
I think the compiler does support namespaces (in the sense that you can create your own namespaces) but the standard c++ headers have not been placed in the std namespace as they are supposed to be. That's why you can't use std::cout. Richard.
Feb 15 2002
parent Jan Knepper <jan smartsoft.cc> writes:
Richard Johnson wrote:

 "David Rasmussen" <pinkfloydhomer yahoo.com> wrote in message
 news:a4hg6h$th4$1 digitaldaemon.com...
 The compiler doesn't seem to support namespaces either?!

 #include <iostream>

 int main()
 {
     std::cout << "Hello World!" << std::endl;

     return 0;
 }

 This produces errors, when compiled, even if iostream.h is used instead...

 Can this be true?? I thought this compiler was good!

 /David
I think the compiler does support namespaces (in the sense that you can create your own namespaces)
Correct to some extend. Walter is working on this.
 but the standard c++ headers have not been placed in the std namespace as they
 are supposed to be. That's why you can't use std::cout.
Correct. Jan
Feb 15 2002