Code::blocks doesn't recognize <iostream> during compilation

Firstly, I'm new to the language and to programming as a whole so I apologize in advance for my "newbishness", for lack of a better term. I recently downloaded the code::blocks ide and I was able to compile the 'main.cpp' file that came preloaded into my first workspace (Hello World). However, when writing my own code in a new file within that same project and attempting to compile it, I get the error that the header <iostream> is not recognized. Even when I save the new file as a .cpp rather than a .c extension, I get the same message and a new file window is made with the same code but with a .c extension. Is there an obvious setting I need to change? I did set the language as C++ when beginning the new workspace.

Thank you for the help, it is much appreciated
Sorry that you haven't gotten any responses yet, but a lot of us use Code::Blocks and that's not a typical issue. To be able to better help you out, I need three things, the exact code of your program, the complete error log (the thing at the bottom), and most importantly, a screenshot of your IDE when you encounter the error. There are several things that can be causing it, those pieces will help narrow down a lot of possible problems.

My other suggestion is to post on the C::B forums, they know a lot more about the specific IDE issues, more so than the average programmer would.
my visual basic doesn't work unless i #include "stdafx.h" at the top.

maybe you have one of the headers out of order?
No, #include "stdafx.h" is only for Visual Studios. It's just a large collection of garbage header files that most people don't even need. As long as #include <iostream> is included in a basic C++ program, it should work perfectly fine.
I believe the issue was fixed when I manually selected to build the project from the toolbar, as opposed to using the F9 prompt button, which now works fine after having built it from the project>build toolbar once. Thank you for the responses and if the issues recurs I will post the code and the screenshots!
Topic archived. No new replies allowed.