Author Topic: How to: debug and release version !  (Read 22686 times)

Offline toutarrive

  • Multiple posting newcomer
  • *
  • Posts: 11
How to: debug and release version !
« on: November 07, 2007, 01:31:40 pm »
hello all,

When compiling my projects i've only got a debug version never a release one!! Do i miss something to compile both versions? Thanks for you help.

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: How to: debug and release version !
« Reply #1 on: November 07, 2007, 01:49:46 pm »
There is no such thing as a "debug version" and a "release version" in Code::Blocks.

It's just that these flipping stupid wizards generate a "debug" and a "release" target to make all the Visual Studio users who are unable to think outside the braindead Visual Studio scheme happy.

What you have in Code::Blocks is build targets, these can be anything, any valid collection of options, paths, defines, and source files.
If you turn on optimisations and turn off debug symbols, and define NDEBUG for a target, then you have what you would call a "release version". If you then call this target "release", it looks like in Visual Studio, too. But that is not the only possible thing, and it is not how it has to be, necessarily.

To address your problem and build your "release" target, you have two options:
1. Select "release" from the build target combo box in the toolbar. This will build only "release"
2. Open project options, and make a virtual build target (you can choose any name you want, but for example "All" or "Everything" would be fit) , then add "debug" and "release" to that virtual build target. Close Project options, and select "All" from the build target menu in the toolbar. Now, this will build both "debug" and "release" in one go. (hint: make sure you have distinct output executable names, or the latter will overwrite the former).
« Last Edit: November 07, 2007, 01:52:28 pm by thomas »
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline toutarrive

  • Multiple posting newcomer
  • *
  • Posts: 11
Re: How to: debug and release version !
« Reply #2 on: November 07, 2007, 04:19:05 pm »
thanks Thomas for you help. it is just what i was looking for.

I'm using Boost librairies for several project (which come with "debug" and "release" libraries as you know) and a makefile to generate a debug or a release version of my exec . I thought that C::B would generate automatically both version at the same build.

Even though, I do rather have more granularity using gcc's options and a makefile. But i got a few problem with NDEBUG and how to use it...

I got the last nightly build today and surprisingly enough it couldn't run at all.  I've noticed a difference in the size of code block exe (from 1069 ko (SVN 4564) to a little more than 800 ko) .

Do i miss again something since SVN 4564?

olivier

vincent

  • Guest
Re: How to: debug and release version !
« Reply #3 on: August 03, 2016, 05:08:09 pm »
you can find Release option in Build menu

for release
Build > Select target > Release

for debug mode
Build > Select target > Debug

@C::B v16.01

Offline ouch

  • Almost regular
  • **
  • Posts: 223
Re: How to: debug and release version !
« Reply #4 on: August 04, 2016, 12:18:28 am »
Ah! Zombies!

lol, I know your new here but seriously, this thread is from 2007...