Code::Blocks Forums

User forums => Help => Topic started by: ragnar.ruutel on June 26, 2012, 11:37:08 am

Title: Codeblocks compiles but doesn't run executable
Post by: ragnar.ruutel 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 ...

(https://lh4.googleusercontent.com/-4ffCz0MmWpg/T-jZ0BTj8iI/AAAAAAAAAuM/wAtWViiuwuY/s400/tool.png)

... 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.
Title: Re: Codeblocks compiles but doesn't run executable
Post by: jarod42 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).
Title: Re: Codeblocks compiles but doesn't run executable
Post by: ragnar.ruutel on June 26, 2012, 12:14:07 pm
It was checked by default.

(https://lh6.googleusercontent.com/-rFj72uOALdw/T-mKiG0IXAI/AAAAAAAAAug/I4RfDmMCDnY/s640/targets.png)

The weird thing is that I don't event get any error message...
Title: Re: Codeblocks compiles but doesn't run executable
Post by: ragnar.ruutel 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 :)

(https://lh6.googleusercontent.com/-JiLPOGHrwJE/T-vZscnZITI/AAAAAAAAAus/wOQ3tDSroiM/s640/compiler.png)

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.