How to get rid of the fatal error about iostream

B

Bill Sun

Hi,

I just want to using a console application in the .net enviroment.

Before the main(), I using the
#include "iostream.h"

but the .net tell me:
c:\project\console\console\console.cpp(11): fatal error C1083: Cannot open
include file: 'iostream.h': No such file or directory

By the way, I want to compile the MS's program: ADOXCreateDatabaseX.cpp
about ADO.

The .net always told me:
c:\project\console\console\Debug\msado15.tlh(2374) : error C2059: syntax
error : '-'
c:\project\console\console\Debug\msado15.tlh(2374) : error C2238: unexpected
token(s) preceding ';'


What wrong with .net, if using the VC6.0, there are no those problem.
Who can help me?

Thanks in advanced,

Bill
 
C

Carl Daniel [VC++ MVP]

Bill said:
Hi,

I just want to using a console application in the .net enviroment.

Before the main(), I using the
#include "iostream.h"

but the .net tell me:
c:\project\console\console\console.cpp(11): fatal error C1083: Cannot
open include file: 'iostream.h': No such file or directory

By the way, I want to compile the MS's program:
ADOXCreateDatabaseX.cpp about ADO.

The .net always told me:
c:\project\console\console\Debug\msado15.tlh(2374) : error C2059:
syntax error : '-'
c:\project\console\console\Debug\msado15.tlh(2374) : error C2238:
unexpected token(s) preceding ';'


What wrong with .net, if using the VC6.0, there are no those problem.
Who can help me?

You need to use <iostream> (no .h).

Background: VC has supported two different versions of IOStreams for
several years. "Classic IOStreams", as implemented in <iostream.h> (etc),
and "Standard IOStreams", as implemented in <iostream> (etc). Note the lack
of the .h in the standard iostreams header file names.

VC7.0 deprecated the "classic IOStreams" and VC7.1 dropped support for
"classic IOstreams" altogether.

Frequently it's as simple as replacing #include <iostream.h> with #include
<iostream> and adding a 'using namespace std;', but depending on exactly
what you're doing with streams, more work may be necessary.

Check any up to date C++ programming book for basics of Standard IOStreams
programming (e.g. "Accelerated C++" by Andrew Koenig and Barbara Moo). If
you need the ultimate reference, look for "Standard C++ IOStreams and
Locales" by Angelika Langer & Klaus Kreft.

-cd
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top