tags:

views:

331

answers:

3

i want to run a c program in code blocks ide but not able install the compiler to run . How to do it ?

A: 

Code::Blocks comes with a MinGW so you should be able to write the code and do F9.

This is the example C code that comes with CB

#include <stdio.h>
#include <stdlib.h>

int main()
{
 printf("Hello world!\n");
 return 0;
}

And it works with F9

Ólafur Waage
after doing f9 i only get the build log , nothing else ! no window to display to show the output
mekasperasky
What operating system are you on?
Ólafur Waage
i am on windows xp
mekasperasky
Code::Blocks with MinGW install should be a next next finish install for you. If you have any information (like any errors or anything)
Ólafur Waage
+1  A: 

Build and run your program separately instead of hitting F9. Hit Ctrl+F9 to build the program, check the build output to make sure it built successfully, and then hit Ctrl+F10 to run it. If the program doesn't run, did you get any error messages?

Instead of running the program, you may want to use F8 to run the debugger.

Also, browse to your project folder and see if you can find the compiled program there. If not, then something likely went wrong during the build process and you somehow didn't get any output messages about it.

bta
A: 

have you gotton code blocks with the MinGW pakage if not then download it separately using the auto installer http://sourceforge.net/downloads/mingw/Automated%20MinGW%20Installer/mingw-get/mingw-get-0.1-mingw32-alpha-2-bin.tar.gz/

but if you want gcc 4.5 then you will have to download every component separability.

After installation that open codeblocks goto compiler and debugger tab under settings , from there goto tool chain executables and click auto detect, it should work.

xeon111