Author Topic: Trouble Compiling  (Read 4100 times)

seafowl

  • Guest
Trouble Compiling
« on: March 21, 2008, 04:16:36 am »
I'm embarrassed to ask this question since its so simple, but I can't figure out how to use CodeBlocks to compile a file. I'm using Windows Vista, and I just installed CB. All of my settings are set to the default installation settings; I haven't changed anything yet. I created a new project, and wrote this program to try it out:

   #include <stdio.h>

   int main(void)
   {
       printf("Hello World");
       return 0;
   }

Then I clicked the Build button on the left hand side of the Compiler tool bar - but nothing seemed to happen. I clicked Run and I was asked, "It seems that this file has not been built yet. Do you want to build it now?" I clicked Yes and nothing happened there either.

Does anyone know what step I'm missing? Perhaps I have the wrong compiler selected? Is it possible that I don't have any compilers selected at all? I realize that CodeBlocks is only an IDE but I assumed that my computer ought to have some kind of its own compiler already installed by virtue of being a computer. I assumed the list of compilers I was presented with to choose one as default were the compilers which CodeBlocks had automatically detected but I'm not sure at all. I'm new to programming, so I don't really know what to do about this.
« Last Edit: March 21, 2008, 04:31:01 am by seafowl »

Offline JGM

  • Lives here!
  • ****
  • Posts: 518
  • Got to practice :)
Re: Trouble Compiling
« Reply #1 on: March 21, 2008, 04:36:46 am »
If you downloaded the bundle setup of codeblocks you should have the mingw compiler installed. In any case go to http://www.codeblocks.org/downloads/5 and donwload the one that says codeblocks-8.02mingw-setup.exe

skainstein

  • Guest
Re: Trouble Compiling
« Reply #2 on: March 31, 2008, 02:30:31 pm »
I had the same problem but i've fixed it. :D

Try this:

Go to Settings -> Compiler & Debugger Settings. then get to the Tab "Toolchain executables" and do auto-detect (compiler's installation directory).

That worked for me 8)

Hope it helps!

Offline dmsundaram

  • Single posting newcomer
  • *
  • Posts: 4
Re: Trouble Compiling
« Reply #3 on: September 30, 2008, 07:32:16 am »
Good Information!  :).

Thanks


- Meenakshi Sundaram
  NetLink Technologies Ltd,
  Chennai.