Results 1 to 3 of 3
Ok so this is the code i wrote below
Code:
#include <iostream>
using namespace std;
int main()
{
int thisisanumber;
cout<<"Please enter a number: ";
cin>> thisisanumber;
cin.ignore();
cout<<"You entered: ...
- 08-31-2010 #1Linux Newbie
- Join Date
- May 2009
- Location
- Kitchener, Ontario, Canada
- Posts
- 187
[SOLVED] C++ with codeblocks in Windows 7
Ok so this is the code i wrote below
Code:#include <iostream> using namespace std; int main() { int thisisanumber; cout<<"Please enter a number: "; cin>> thisisanumber; cin.ignore(); cout<<"You entered: "<< thisisanumber <<"\n"; cin.get(); }
it errors out by saying "error: iostream: No such file or directory
in function 'main':
error 'cout' undeclared
any ideas?
- 08-31-2010 #2Just Joined!
- Join Date
- Dec 2009
- Location
- Maryland, USA
- Posts
- 83
I'm curious why you're asking Windows 7 programming questions in a Linux forum. There are C++ programming forums for Windows that might be better suited to answer your questions.
It appears that you don't have the C++ compiler/development environment installed or set up correctly on your Windows machine. The C++ compiler you've installed should be able to find the C++ libraries it needs, like iostream, to compile your programs. Review the requirements for your environment and the install you performed (or didn't perform) and fix whatever's wrong.
- 08-31-2010 #3Linux Newbie
- Join Date
- May 2009
- Location
- Kitchener, Ontario, Canada
- Posts
- 187
i actualy figured it out it. i saved it as a C file instead of a cbp file if that makes sense



