My vc++ is insane, please help me.....

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

VC++ refuses to recognize stream classes (such as ofstream and ifstream) when I compile. I wrote the simplest program possible to diagnose the problem and I still have no idea what is going on. I include <iostream> and <fstream> and still get unrecognized identifiers in response to ofstream declarations.

The curious thing is, intellisense recognizes everything properly. What is wrong here??? All properties options are normal and the default include path is set properly (I get no include errors).
Here is the simple program I wrote in which vc++ refuses to compile. Like I said, intellisense gives me all the proper data but seems to forget everything at compile time:

#include <iostream>
#include <fstream>

int main()
{
ofstream file("blah", ios::binary);
file.close();
return 0;
}

errors are "unrecognized identifier ofstream", and everything that stems from that.
 
VC++ refuses to recognize stream classes (such as ofstream and ifstream) when I compile. I wrote the simplest program possible to diagnose the problem and I still have no idea what is going on. I include <iostream> and <fstream> and still get unrecognized identifiers in response to ofstream declarations.
<

Try:

using namespace std;

or prefix the uses with std::
The curious thing is, intellisense recognizes everything properly. What is wrong here?

Intellisense is! :(

Dave
 
Try adding the line indicated.
VC++ refuses to recognize stream classes (such as ofstream and ifstream) when I compile. I wrote the simplest program possible to diagnose the problem and I still have no idea what is going on. I include <iostream> and <fstream> and still get unrecognized identifiers in response to ofstream declarations.

The curious thing is, intellisense recognizes everything properly. What is wrong here??? All properties options are normal and the default include path is set properly (I get no include errors).
Here is the simple program I wrote in which vc++ refuses to compile. Like I said, intellisense gives me all the proper data but seems to forget everything at compile time:

#include <iostream>
#include <fstream>


using namespace std;
 

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

Back
Top