Hello World wont compile

ok so i studied up on how to make a C++ program and to make a C++ seems very easy.
i read on how to make one in the C++ Documentation on this website.

I downloaded an installed Code::Blocks (with MinGW)
i wrote this exact code in a new empty file:
1
2
3
4
5
6
7
8
//My Hello World
#include <iostream>
using namespace std;
int main();
{
cout<<("Hello World!");
return 0;
}


I hit Build and it says this:
C:\Program Files\CodeBlocks\share\CodeBlocks\WorkSpace\Hello World\HelloWorld.c|2|fatal error: iostream: No such file or directory|

in case that's to much for you to read the actual error, i even took a pic, see for your self -_-

http://www.mediafire.com/?oyxmhh4k8t24h4t

It says there's No Such File!?!?
wth, iostream is like, a basic file, u need it for displaying text and prompt for input! how can it NOT be there???

look, i JUST installed codeblocks fresh, 10.5 with MinGW(idk what its for but everyone talks about it...) i didnt change ANY options with the exception of the font size.....

i have only learned about C++ through this documentation, but yet i see other ppl on youtube and such that use completly different commands such as getch() and #include <stdio.h>

do you need to put .h at the end of <iostrem>?
i did that and it gives me the same error.

if i need to configure something, dont think i have any prior knowledge on how to configure an IDE....

as for other information that may help, i didnt just use code blocks, as in, this isnt the first time this happened
i also tryed Dev C++
but seeing that theres a topic on this site JUST for hateing on it, i decided to switch today(That and the fact that they had some good points, such as Dev C++ hasent updated in 6 years....)

PLEASE HELP ME =(
This is basicly it, when im older i wanna become a software designer. i wanna make something amazing just like everyone else xD
im 15 as of now, and my friends all have a little hobby of theres, so i figured that if im gonna be makein programs and things of that sort, i need to start somewhere. i picked C++ because alot of ppl use it, and by ppl i mean 9 year olds on the internet posting videos of programs they made! FREAKIN 9 YEARS OLD! so if they can make some silly number guessing game, what do you think a devoted 15 year old can make? 2 of my other friends already made runescape bots using java! im here playin RPG maker! so yea, ON TO C++ I GO!

so yea, srry to pour out my life story -_- but i rly want this to work...

Thanks VERY much to any help in advance!!
"hello world\helloworld.c"
Idk if this is your error but if you're writing in c++ your extension should be .cpp

the ()'s are not necessary in your cout line.

1
2
3
4
5
6
7
#include <iostream>
using namespace std;
int main()
{
cout << "HELLO WORLD!";
return 0;
}
What you have written looks right to me and that is exactly how I would type it. The only difference being is that I use Visual C++ 2010. I recommend you give that a try, then that will help you narrow down the problem. It might be a code blocks issue.
georgewashere hit it right on the head.
C++ files have a ".cpp" or ".cxx" or ".C" (that's a capital 'C') or ".cc" extension.
C files have a ".c" extension.
The compiler thinks you are compiling a C program (because of your choice of file extension), so it is not looking in the correct directory to find C++ headers.
Anybody else notice he has a semi-colon jsut after the main()? Get rid of that. (line 4)
Topic archived. No new replies allowed.