News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

SOLVED - My simple program will not run - Sample code runs okay

Started by James1st, December 11, 2014, 09:17:27 AM

Previous topic - Next topic

James1st

Hello, I am just getting started. Here is my problem -

I open Code:Blocks
I write:
#include <iostream>
using namespace std;
int main ()
{
    cout << "HEY, you, I'm alive! Oh, and Hello World\n";
    cin.get ();
}
I select, "Build and Run"
I get Build message: "fatal error: iostream: no such file or directory

I clear everything out
I click on "Open"
I navigate to the sample code and select, "Hello"
The code is identical to what I typed in.
This runs with no problems.

Thank you

Jenna

Make sure your file has the correct ending to be recognized as c++-file (e.g. cpp).

James1st

Thank you, that solved my problem. For some reason, I thought that the extension was automatically inserted. I will have to quickly learn not to assume anything!