Author Topic: Won't compile current file  (Read 4675 times)

Offline tinyang

  • Single posting newcomer
  • *
  • Posts: 3
Won't compile current file
« on: May 24, 2009, 04:06:59 pm »
My son is just getting into C programming, and uses CodeBlocks as his IDE.  He was having a problem with some compile errors on a program he wrote, so I installed CodeBlocks 8.02 for windows (I have XP SP3) and tried to compile his program, but nothing happens when I try this.  It doesn't matter if I try using build, build, run, build and run, or compile current file.  All that happens is that the Build log tab in the Logs and others area switches to the active tab.  Can anyone here please help me?  Thanks!

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5913
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Won't compile current file
« Reply #1 on: May 24, 2009, 05:10:43 pm »
nothing happens when I try this

Can't give you any clue from these simple question statement. :D
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline tinyang

  • Single posting newcomer
  • *
  • Posts: 3
Re: Won't compile current file
« Reply #2 on: May 24, 2009, 05:39:57 pm »
Hi olly and thanks for the reply.  Like I said, the only thing that happens is that the Build log tab in the Logs and others area switches to the active tab.  The Build log tab is empty when it does this.  Messing around with it a bit more I noticed that when I try to run it, it says in a dialog box, "It seems that this file has not been built yet.  Do you want to build it now?"  Options are Yes, No and cancel.  If I click yes, nothing happens, the dialog box just disappears.  If I click no, I get a dos window which says, "Process returned 0 (0x0) execution time : 0.000 s Press any key to continue."

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5913
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Won't compile current file
« Reply #3 on: May 24, 2009, 05:45:02 pm »
Which compiler did you use?

MinGW?

How did you install the 8.02 version? Did you installed a MinGW bundled version?

If you configure the correct compiler, then you can use the project wizard to create a "console applications".

Then build and run. :D

That's the way I can tell you. If you have some compiler error or something else, that's another thing. :D
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline tinyang

  • Single posting newcomer
  • *
  • Posts: 3
Re: Won't compile current file
« Reply #4 on: May 24, 2009, 06:04:25 pm »
When I go to Settings, Compiler and debugger settings, it was set to default GNU GCC compiler.  I set the Borland compiler as default and now it works.  Thanks for the help!