User forums > Using Code::Blocks

Newbie wants to make a release version

(1/2) > >>

m15981:
Hi
I have just finished my first app and i was wondering how can i make
a release version of it? You know like in VS that when you compile
you can select between a debug and a release version.
Thank you

TDragon:
The only differences between debug and release versions in any compiler or IDE are the compiler settings. In any compiler, this usually involves:

* Turning off debug symbols
* Turning on optimizations
* #defining NDEBUG (and not _DEBUG or similar)
* Stripping extraneous symbols from the binaryFor GCC, these would be the -g, -On, -D, and -s switches respectively.

jc:
The best way to do this is to set up two different targets (if you imported a VC project, it may already be done this way), one for release, and one for debug. In that case simply clicking on the "Build target:" dialoug under the menu bar (blue buttons) will bring up the Release option.

You can add or change different targets in: Right click project -> Properties -> Targets, these allow you to change the compiler flags for each target.

To turn debugging on or off you just go to: Right click project -> Properties -> Project's build options... -> Compiler flags -> check/uncheck debugging. Other options like optimization are going to be in "Compiler flags," too.

m15981:
Great thank you both for your help but i have another question
When i make a release version with no debug flags and optimisations
and i try to execute the .exe it gives me an error for the dll missing.
How can i change this so when i give the executable there is no need
to give the dll as well?
Thx

thomas:
If you do not want to distribute "the dll" (what dll?), then you have to statically link instead of dynamically (increases executable size). Of course, it somehow depends on what "the" dll is, too.

Navigation

[0] Message Index

[#] Next page

Go to full version