News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

Codeblocks compiles but doesn't run executable

Started by ragnar.ruutel, June 26, 2012, 11:37:08 AM

Previous topic - Next topic

ragnar.ruutel

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.

jarod42

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).

ragnar.ruutel

It was checked by default.



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

ragnar.ruutel

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.