Author Topic: Codeblocks compiles but doesn't run executable  (Read 4584 times)

Offline ragnar.ruutel

  • Single posting newcomer
  • *
  • Posts: 3
Codeblocks compiles but doesn't run executable
« on: June 26, 2012, 11:37:08 am »
I have a new Codeblocks install with mingw32 compiler. Created new c++ console project with default hello world stuff and I hit F9 (Build and Run). Compiles without problems but doesn't run the executable. I created new entry under tools ...



... and when I execute it from the tools menu it opens the cb_console_runner and its all good.
So how do I configure Codeblocks to run my custom tools entry after building (when I hit F9)?

The funny thing is that I have already managed to do this but I forgot exactly how and now I'm unable to find the link.

Offline jarod42

  • Multiple posting newcomer
  • *
  • Posts: 87
Re: Codeblocks compiles but doesn't run executable
« Reply #1 on: June 26, 2012, 12:05:26 pm »
Have you checked in Project -> Properties... -> Build Target
'Pause when execution ends'

(it will not launch your custom tools but pause after execution like in your custom tools configuration).

Offline ragnar.ruutel

  • Single posting newcomer
  • *
  • Posts: 3
Re: Codeblocks compiles but doesn't run executable
« Reply #2 on: June 26, 2012, 12:14:07 pm »
It was checked by default.



The weird thing is that I don't event get any error message...

Offline ragnar.ruutel

  • Single posting newcomer
  • *
  • Posts: 3
Re: Codeblocks compiles but doesn't run executable
« Reply #3 on: June 28, 2012, 06:31:16 am »
It took some time but I figured out a workaround. The reason why Codeblocks didn't execute my program after Compile & run (F9) is because my projects compiler and IDE's default compiler didn't match. I used Mingw32 TDM and default was VC2005/2008. When setting former to default it started working without problems :)



So when You have 2 projects with different compilers and You develop them in parallel, it will get tedious very fast. It should probably use projects settings for this, not IDE's default.