Code::Blocks Forums

User forums => Help => Topic started by: MadCat13 on June 02, 2011, 07:11:52 am

Title: Can't turn off optimizations
Post by: MadCat13 on June 02, 2011, 07:11:52 am
I'm probably missing something obvious, but I can't seem to disable optimizations.  I've turned off all options for my target, except for "produce debugging symbols".  However, whenever I build the target, I always have the -O2 option enabled in the build log.
I've searched the global compiler options and went so far as to turn off the all options for all targets (and the main project) except for debugging symbols, to no avail.  I've even went into the cbp file with a text editor and made sure all optimization options were gone.
I had this happen once before, and I ended up deleting all the Codeblocks files and rebuilding the project.  I don't want to have to do that again if I can help it.

My specs:  Codeblocks 10.05, gcc 4.4.3, Ubuntu 10.04 64-bit.

Any ideas?

Thanks,
MadCat13
Title: Re: Can't turn off optimizations
Post by: Jenna on June 02, 2011, 07:34:46 am
Double-check, that optimization is turned off on project- and target-base ("Project -> Build options") and for the compiler in general ("Settings -> Compiler and debugger... -> GNU GCC Compiler").
If verything is turned off and it still does not work, you can try to remove (or rename) C::B's configuration file (~/.codeblocks/default.conf).
Title: Re: Can't turn off optimizations
Post by: MadCat13 on June 02, 2011, 05:54:51 pm
I finally realized what the problem was.  It turns out that a script for one of the libraries I am using was inserting its own compiler flags.  It kept inserting the -O2 flag.

I've gotten around it by adding an -O0 after the call to the library script.

The first time, when I rebuilt the project, I stopped using the library and didn't associate the two until just now.

Sorry for the trouble, and thanks for the help.

MadCat13