www.digitalmars.com Home | Search | C & C++ | D | DMDScript | News Groups | index | prev | next
Archives

D Programming
D
D.gnu
digitalmars.D
digitalmars.D.bugs
digitalmars.D.dtl
digitalmars.D.dwt
digitalmars.D.announce
digitalmars.D.learn
digitalmars.D.debugger

C/C++ Programming
c++
c++.announce
c++.atl
c++.beta
c++.chat
c++.command-line
c++.dos
c++.dos.16-bits
c++.dos.32-bits
c++.idde
c++.mfc
c++.rtl
c++.stl
c++.stl.hp
c++.stl.port
c++.stl.sgi
c++.stlsoft
c++.windows
c++.windows.16-bits
c++.windows.32-bits
c++.wxwindows

digitalmars.empire
digitalmars.DMDScript

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

↑ ↓ ← 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
↑ ↓ "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
↑ ↓ 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
↑ ↓ → "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