Author Topic: Problem running exe file after adding target to project  (Read 4323 times)

Offline freeze

  • Single posting newcomer
  • *
  • Posts: 6
Problem running exe file after adding target to project
« on: December 29, 2011, 07:57:04 pm »
I am new to CodeBlocks, and learning my way around.
I would like to be able to add a "Release" target to a project that was created using the Wizard with only a "Debug" target.

Here is what happens:
Console project created using the Wizard with "Debug" target only.
Built and run with no problem.
"Release" target added  (Project/Properties/Build targets: "Add" clicked, new target given name "Release", Output filename changed to "bin\Release\TargetTest.exe", Objects output dir changed to "obj\Release\", main.cpp checked under "Build target files".
Under Project build options, "Produce debugging symbols" unchecked.
The new release project builds with no errors, and in fact an exe file is created in the bin\Release\ directory.
However, when I press F9 to run the program, nothing happens. No console, and no output.
Here is what CodeBlocks has to say:
Checking for existence: C:\Documents and Settings\john\My Documents\CB_Projects\TargetTest\bin\Release\TargetTest.exe
Executing: "C:\Documents and Settings\john\My Documents\CB_Projects\TargetTest\bin\Release\TargetTest.exe"  (in C:\Documents and Settings\john\My Documents\CB_Projects\TargetTest\.)
Process terminated with status 0 (0 minutes, 0 seconds)
 
The "Debug" target displays a console and output as expected.
I am sure I am neglecting something that should be obvious, but I am stuck and would appreciate help.
Thank you.

Offline freeze

  • Single posting newcomer
  • *
  • Posts: 6
Re: Problem running exe file after adding target to project
« Reply #1 on: December 29, 2011, 09:13:23 pm »
OK, I found the problem. I had not noticed that I had to choose "Console" instead of "GUI".
Nevertheless, I am still interested in whether I have done everything correctly in terms of settings needed to add a "Release" target properly.
Thank you.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7785
    • My Best Post
C Programmer working to learn more about C++ and Git.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org