Thread overview | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
February 13, 2002 does dm support c++ standard header names? | ||||
---|---|---|---|---|
| ||||
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. |
February 14, 2002 Re: does dm support c++ standard header names? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Richard Johnson | 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 |
February 14, 2002 Re: does dm support c++ standard header names? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jan Knepper | "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. |
February 14, 2002 Re: does dm support c++ standard header names? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Richard Johnson | > 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 |
February 14, 2002 Re: does dm support c++ standard header names? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jan Knepper | "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. |
February 14, 2002 Re: does dm support c++ standard header names? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Richard Johnson | "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 |
February 14, 2002 Re: does dm support c++ standard header names? | ||||
---|---|---|---|---|
| ||||
Posted in reply to David Rasmussen | 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
|
February 15, 2002 Re: does dm support c++ standard header names? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jan Knepper | "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. |
February 15, 2002 Re: does dm support c++ standard header names? | ||||
---|---|---|---|---|
| ||||
Posted in reply to David Rasmussen | "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. |
February 15, 2002 Re: does dm support c++ standard header names? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jan Knepper | "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 |
Copyright © 1999-2021 by the D Language Foundation