www.digitalmars.com         C & C++   DMDScript  

c++ - can't compile with iostream.h

reply Cleatis <Cleatis_member pathlink.com> writes:
I am trying to compile a simple hello-world program and I can't seem to compile
correctly.  I only have the downloaded version, but here is the error I get:

Use C++ compiler for iostream.h - invoke with -cpp switch --- errorlevel1

My program is as follows:
#include <iostream.h>

void main()
{  
cout << "hello world";
}

I saved my file in C:\dm\bin as helloworld.c 
And I am compiling from the C:\dm\bin folder by typing dmc helloworld.

Please help,
Thanks,
James
Apr 21 2005
parent reply "Walter" <newshound digitalmars.com> writes:
Try:
    dmc helloworld -cpp

"Cleatis" <Cleatis_member pathlink.com> wrote in message
news:d49mpa$1a1n$1 digitaldaemon.com...
 I am trying to compile a simple hello-world program and I can't seem to

 correctly.  I only have the downloaded version, but here is the error I

 Use C++ compiler for iostream.h - invoke with -cpp switch --- errorlevel1

 My program is as follows:
 #include <iostream.h>

 void main()
 {
 cout << "hello world";
 }

 I saved my file in C:\dm\bin as helloworld.c
 And I am compiling from the C:\dm\bin folder by typing dmc helloworld.

 Please help,
 Thanks,
 James

Apr 21 2005
parent reply Cleatis <Cleatis_member pathlink.com> writes:
I tried that and it creates a file called helloworld.obj.  I still get an error
though.  It says:
OPTLINK : Error 118:Filename Expected
LIB = "C:\Documents and Settings\MyFolder\dm\bin\..\lib";
LIB = "C:\Documents and Settings\MyFolder\dm\bin\..\mfc\lib";

---  Error Level 1

Any ideas????

Thanks again,
James


In article <d49ro5$1ecb$1 digitaldaemon.com>, Walter says...

Try:
    dmc helloworld -cpp

"Cleatis" <Cleatis_member pathlink.com> wrote in message
news:d49mpa$1a1n$1 digitaldaemon.com...
 I am trying to compile a simple hello-world program and I can't seem to

 correctly.  I only have the downloaded version, but here is the error I

 Use C++ compiler for iostream.h - invoke with -cpp switch --- errorlevel1

 My program is as follows:
 #include <iostream.h>

 void main()
 {
 cout << "hello world";
 }

 I saved my file in C:\dm\bin as helloworld.c
 And I am compiling from the C:\dm\bin folder by typing dmc helloworld.

 Please help,
 Thanks,
 James


Apr 21 2005
parent "Walter" <newshound digitalmars.com> writes:
The problem is you've installed it into a directory with spaces in it (which
causes problems with the linker). Try installing it in a directory without
spaces.

"Cleatis" <Cleatis_member pathlink.com> wrote in message
news:d4a1qb$1kor$1 digitaldaemon.com...
 I tried that and it creates a file called helloworld.obj.  I still get an

 though.  It says:
 OPTLINK : Error 118:Filename Expected
 LIB = "C:\Documents and Settings\MyFolder\dm\bin\..\lib";
 LIB = "C:\Documents and Settings\MyFolder\dm\bin\..\mfc\lib";

 ---  Error Level 1

 Any ideas????

 Thanks again,
 James


 In article <d49ro5$1ecb$1 digitaldaemon.com>, Walter says...

Try:
    dmc helloworld -cpp

"Cleatis" <Cleatis_member pathlink.com> wrote in message
news:d49mpa$1a1n$1 digitaldaemon.com...
 I am trying to compile a simple hello-world program and I can't seem to

 correctly.  I only have the downloaded version, but here is the error I

 Use C++ compiler for iostream.h - invoke with -cpp switch --- 



 My program is as follows:
 #include <iostream.h>

 void main()
 {
 cout << "hello world";
 }

 I saved my file in C:\dm\bin as helloworld.c
 And I am compiling from the C:\dm\bin folder by typing dmc helloworld.

 Please help,
 Thanks,
 James



Apr 22 2005