In Need of Assistance

I have been having a problem with my IDE lately. I am using the latest version of Code::Blocks. When I try to build I am greeted with a wonderfully red list of error messages. All the errors are product of the initial two that read "error: iostream: no such file or directory" and "error: cstdlib: no such file or directory". No matter how I call header files I get this message. Ive checked my directory and the files are all there. Ive even taken some advice from friends, like reinstall Code::Blocks or try a new IDE, none have worked they all suffer from the same issue. It hasn't always done this, I haven't been changing settings. Any advice would help, I would really like to continue programming as soon as possible
Try this program:
1
2
3
4
5
6
7
#include <iostream>

using namespace std;

int main(){
     cout << "Hello World!" << endl;
}


I know it sounds retarded, but see what happens.
code::block is an IDE, can be installed with or without a compiler. The errors you state suggest that your compiler isn't installed correctly.

Are you sure you have a compiler installed to work with Code::blocks? The libraries are part of any standard c++ compiler, like gcc, Microsoft, or Borland.

If those aren't your issues, could you post the code you are trying to compile?
Sorry ciphermagi, I am receiving the same errors as before.
I'm almost certain Code::Blocks was packaged with gcc. But I can try installing it to see what happens.
I'm not sure if this is important but have you tried to add your compiler to the Environment Path's Variable? I remember I had to do that in the past.
... I'm confused. I was just talking to a friend of mine, and by the instructions he gave me I can compile through a command prompt using gcc. But Code::Blocks still doesn't compile. I'm almost certain this wont help, but here is my code:

#include <iostream>
#include <cstdlib>
using namespace std;

int main()
{
int Temp, Counter=0, Random=(rand()%15)+1;

for(Counter<=50)
{
cout << Random;
Counter++;

else
{
cout << "COMPLETE";
cin >> Temp;
}
}
}
return 0;
Last edited on
Have you listed the GCC as the compiler for Code::Blocks? Go to the compiler and debugger settings near the top right and click "auto find" or something for the compiler.
Gcc is added to the path variable, my friend had me do that to compile in command prompt. I'll post as soon as I'm able to get to my computer about whether or not I'm able to select it as my compiler in the settings. Though last time I tried I don't recall seeing an ''Auto Find'' feature, all I remember is a list of about 20 different compilers (about 8 of which contained gcc in the name)
Last edited on
Sorry, I was on my other computer when I wrote that.


Okay, open up Code Blocks.

Go to Settings -> Compiler and Debugger

Now, at the top where it says "Selected Compiler", pick GNU GCC Compiler. This is if you installed MinGW as well.

Now, on that same window, tab to "Toolchain Executables".

Click on "Auto-Detect". Press okay.

Tell me if that works.

I've had the same problem.

It solved first after a re-installation of my whole computer :(

When i tried to "Auto-Detect" it came up with nothing.
Still nothing... *sigh* This is really discouraging. I'd like to fix this without doing a complete reinstall of windows. Thanks for all the help so far though, I really appreciate it, the community here is great.
:( that's really weird.
Okay, let's get this straight.
Let's try to reinstall the code::blocks.

This will work.

1) Okay, first, download this "codeblocks-10.05mingw-setup.exe" for Windows.

Link: http://www.codeblocks.org/downloads/26

I think most people would pick sourceforge.

2) Install it. Now, go ahead and do "Auto-Detect" now. After that, if it's still not working, then add the MinGW directory of which came with the Code::Blocks to your Environment Variables.

Tell me if that works. If it still doesn't work then it's your you've added your Environment Variables path wrong.

Last edited on
Nothing at all... :(
I know I add the Environment Path correctly. Right clicked My Comp, Advanced System Settings, Environment Variables... I added both the C:\Program Files (x86)\CodeBlocks\MinGW\bin and C:\MinGW\bin directories.
Darn it. Its hard to believe that didn't work. :(

Maybe you should make this post again in the General section so more advanced programmers can help you.

Maybe they'll know what the problem is. I'm sorry I couldn't help.

Thanks for all the help guys, especially you moon, Ill try posting in general.
Have you tried going to Windoze Add/Remove Program Wizard and removing Code::Blocks? If you don't use the wizard, sometimes windoze will hold on to some of your cfg files and apply them if you re-install.
Topic archived. No new replies allowed.