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

HELP!! (kind of repetitive, yes.)

P: n/a
hello.
i tried this for a simple push_back action..... it says "ostream - no
such file or directory"

#include <iostream>
#include <conio2.h>
#include <string>
#include <ostream>
int main()
{
clrscr();
std::cout<<"rough engine of ecod\n\n";
std::cout<<"please input text\n\n";
std::cout<<"when you have completely typed in the message, please
press enter\n\n";
std::string str;
getline(std::cin,str,'\n');
str.push_back('\n');
std::cout<<str;
}

compiler error: ostream: no such file or directory
what am i supposed to do?

Dec 9 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
On 2006-12-09 13:39, MC felon wrote:
hello.
i tried this for a simple push_back action..... it says "ostream - no
such file or directory"

#include <iostream>
#include <conio2.h>
#include <string>
#include <ostream>
int main()
{
clrscr();
std::cout<<"rough engine of ecod\n\n";
std::cout<<"please input text\n\n";
std::cout<<"when you have completely typed in the message, please
press enter\n\n";
std::string str;
getline(std::cin,str,'\n');
str.push_back('\n');
std::cout<<str;
}
Removing the #include <conio2.h>, clrscr(), and fixing the linebreak
this compiles perfectly fine for me. If this is really the code that
fails you have a problem with your environment and will have to look for
support somewhere else.

--
Erik Wikström
Dec 9 '06 #2

P: n/a
MC felon wrote:
hello.
i tried this for a simple push_back action..... it says "ostream - no
such file or directory"

#include <iostream>
#include <conio2.h>
#include <string>
#include <ostream>
int main()
{
clrscr();
std::cout<<"rough engine of ecod\n\n";
std::cout<<"please input text\n\n";
std::cout<<"when you have completely typed in the message, please
press enter\n\n";
std::string str;
getline(std::cin,str,'\n');
str.push_back('\n');
std::cout<<str;
}

compiler error: ostream: no such file or directory
what am i supposed to do?
I cannot reproduce that error from your code. It would appear that your
compiler is not set up correctly and does not find some of the standard
headers. You should post your problem in a forum where the quirks of your
particular compiler are topical.
Best

Kai-Uwe Bux
Dec 9 '06 #3

P: n/a
"MC felon" <pa******@gmail.comwrote in message
news:11**********************@79g2000cws.googlegro ups.com

Not just repetitive, dumb too. Try giving your posts subjects that actually
convey useful information.
hello.
i tried this for a simple push_back action..... it says "ostream - no
such file or directory"

#include <iostream>
#include <conio2.h>
#include <string>
#include <ostream>
Let's see now. What are the possibilities?

Either the ostream header exists on your system or it doesn't.

If it does exist, then presumably there is some problem with the way you
have set up directories in your IDE so the file isn't being found. If it
doesn't exist, then either there is a problem with your installation or you
have a non-standard implementation. Either reinstall or get a different
implementation, as appropriate.

Just by the way, you rarely need to #include <ostreamdirectly. Just
#including <iostreamnormally suffices. You might try simply removing
#include <ostream>
int main()
{
clrscr();
std::cout<<"rough engine of ecod\n\n";
std::cout<<"please input text\n\n";
std::cout<<"when you have completely typed in the message, please
press enter\n\n";
std::string str;
getline(std::cin,str,'\n');
str.push_back('\n');
std::cout<<str;
}

compiler error: ostream: no such file or directory
what am i supposed to do?

--
John Carson
Dec 9 '06 #4

P: n/a

Not just repetitive, dumb too. Try giving your posts subjects that actually
convey useful information.
i'll try. only that i'm such a newbee that i'm still struggling to make
the major shift from turbo c++ to a STANDARD compiler.
thanks anyway, i'm switching to CODE::BLOCKS RC1

Dec 10 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.