Hi everybody I'm new to this forum and new to C++. I'm not a newbie to forums in general and I have done searches but can't find a solution that works. I'm using code blocks 10.05 with mingw. I'm following directions from cprogramming.com to start my learning on this programming language. The problem I'm having is i'm getting the error code:
C:\Users\Yu\Documents\C++\practice\Untitled1.c|1|error: iostream: No such file or directory|
I started a new project > chose console application > C++ > new file > empty file
main.cpp works fine with iostream but if i use the following code, it won't work.
#include <iostream>
using namespace std;
int main()
{
cout<<"HEY, you, I'm alive! Oh, and Hello World!\n";
cin.get();
}
I got the code from cprogramming.com tutorials. One problem I've noticed is the program saves as a .c while the main file is a .cpp. I can't seem to figure out how to save my code as a .cpp file and everytime i run it i get the same exact following error codes.
C:\Users\Yu\Documents\C++\practice\Untitled1.c|1|error: iostream: No such file or directory|
C:\Users\Yu\Documents\C++\practice\Untitled1.c|3|error: expected '=', ',', ';', 'asm' or '__attribute__' before 'namespace'|
C:\Users\Yu\Documents\C++\practice\Untitled1.c|7|error: 'cout' undeclared (first use in this function)|
C:\Users\Yu\Documents\C++\practice\Untitled1.c|7|error: (Each undeclared identifier is reported only once|
C:\Users\Yu\Documents\C++\practice\Untitled1.c|7|error: for each function it appears in.)|
C:\Users\Yu\Documents\C++\practice\Untitled1.c|8|error: 'cin' undeclared (first use in this function)|
i think the cout and cin errors appear because of the iostream error. if i don't start a project, the code works fine. i know iostream is a header file and i have it in the program files folder. i guess my question is how do i direct that file to be used in my code?
i hope i posted in the right section, if not if an admin could please move it to the correct section. TIA