std::string input not working, VC++6.0

Pages: 12
Now I've gotten this:

microsoft visual studio\vc98\include\ostream(9) : fatal error C1083: Cannot open include file: 'ios': No such file or directory

I don't understand... lol
Probably a fail with typing in #include <iostream> and accidentally typing #include <ios> or maybe #include <ios tream> ?
Last edited on
I don't think so... here's a copy and paste from my includes:
1
2
3
4
5
6
7
#include <iostream.h>
#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
#include <vector>
#include <string.h>
#include <string> 

I read online that:
1
2
3
4
namespace std
{
#include <cstdlib>
};

Might fix the problem, but it didn't.
closed account (zb0S216C)
You need a modern compiler. "iostream.h" is a C header. C++ headers have no extension.

NerdTastic wrote:
1
2
3
4
namespace std
{
#include <cstdlib>
};

That would only cause more errors. As you know, #include in-lines files. This would mean the std namespace would reside in the std namespace. Of course, this isn't good.

Wazzak
Yeah I sent a message to my instructor requesting that he either let me use my laptop (which has 2010 express) or get it for the school himself.
VC6.0 is a reasonable environment to learn C++. The template spec it implements isn't what we'd expect now and there are bugs in the containers and other limitations. But the environment is sufficient for what you're doing.

You're not exactly following the advice that's been given. You're still using iostream.h and you probably don't need string.h.
If I take out the .h in iostream, i get the same error (cannot open include file ios)

EDIT: i did this to make sure it was actually iostream causing the program, I commented out string and got rid of string.h
1
2
3
4
5
6
7
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
#include <vector>

//#include <string> 
Last edited on
Topic archived. No new replies allowed.
Pages: 12