News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

Will not run in Release Mode (testing)?

Started by dominover, August 22, 2014, 04:45:39 PM

Previous topic - Next topic

dominover

Is there any way using CodeBlocks to test why a project will not run in Release mode.
I can run the project in Debug Mode fine.  When running in Release mode, the project works but no console appears. When running in Debug mode the console appears and it runs as it should.  The Test_Project is only a few lines long so there is no issue with the code.  I've tested several.  I know it's not necessarily a codeblocks issue but I'm wondering if you can test it using the CodeBlocks IDE to find out why this is occuring?  Below comes from the 'Build Message' tab below the code editor when I run the code.  The Debug and Release mode provide the same message but the Release mode console doesn't appear.


Run: Debug in Test_Project (compiler: GNU GCC Compiler) ===|
Run: Release in Test_Project (compiler: GNU GCC Compiler) ===|


stahta01

Try reading/posting the "Build Log".

Tim S.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

gd_on

#2
Or, may be your program ends too early, before you can see something. As shown in http://wiki.codeblocks.org/index.php?title=Creating_a_new_project#Modifying_build_options, did you check "Pause when execution ends" in the project properties? or add a getchar() just before the end of your program...

gd_on
Windows 11 64 bits (25H2), svn C::B (last version or almost!), wxWidgets 3.3.2, Msys2 Compilers 16.1.0, 64 bits (seh, posix : gcc, g++ and gfortran in C:\msys64\mingw64) or 32 bits (dwarf2, posix  in C:\msys64\mingw32).

dominover

Well, it builds fine and if I place a system("pause") in there it will stop with a blank screen.
It's when I run the program the problem surfaces.  Not in Debug mode though.  Very strange.

It started when I upgraded my compiler to the latest CodeBlocks 13.12 with Mingw 4.81. 

oBFusCATed

Project -> Properties -> Build targets -> Pause when execution ends?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

dominover

OK Scholars.. I've solved it.
When I upgraded to the latest CodeBlocks and added some templates it seems that at some stage the default settings have changed in my projects (specifically in my templates I saved with new libraries added).

The programs were running in release mode but the console wasn't appearing.

In the WorkSpace on the LHS of the editor I did this.

Right Clicked > Properties > Selected the Build targets Tab > the second combobox down in that window marked Type: allows you to select GUI Application or Console Application.  I just selected Console Application and everything runs well now. Hooray.  This has taken me 2 days to fix.