By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,857 Members | 1,768 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,857 IT Pros & Developers. It's quick & easy.

How to get rid of the fatal error about iostream

P: n/a
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
Nov 16 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Bill Sun wrote:
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
Nov 16 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.