Author Topic: Will not run in Release Mode (testing)?  (Read 5822 times)

Offline dominover

  • Multiple posting newcomer
  • *
  • Posts: 46
Will not run in Release Mode (testing)?
« on: August 22, 2014, 04:45:39 pm »
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.


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

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: Will not run in Release Mode (testing)?
« Reply #1 on: August 22, 2014, 05:03:04 pm »
Try reading/posting the "Build Log".

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

Offline gd_on

  • Lives here!
  • ****
  • Posts: 797
Re: Will not run in Release Mode (testing)?
« Reply #2 on: August 22, 2014, 07:19:41 pm »
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
« Last Edit: August 22, 2014, 07:22:00 pm by gd_on »
Windows 11 64 bits (23H2), svn C::B (last version or almost!), wxWidgets 3.2.4 (tests with 3.3), Msys2 Compilers 13.2.0, 64 bits (seh, posix : gcc, g++ and gfortran in C:\msys64\mingw64) or 32 bits (dwarf2, posix  in C:\msys64\mingw32).

Offline dominover

  • Multiple posting newcomer
  • *
  • Posts: 46
Re: Will not run in Release Mode (testing)?
« Reply #3 on: August 22, 2014, 08:35:28 pm »
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. 

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Will not run in Release Mode (testing)?
« Reply #4 on: August 22, 2014, 09:01:01 pm »
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!]

Offline dominover

  • Multiple posting newcomer
  • *
  • Posts: 46
Re: Will not run in Release Mode (testing)?
« Reply #5 on: August 22, 2014, 09:01:43 pm »
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.