Code::Blocks

User forums => General (but related to Code::Blocks) => Topic started by: SasMaster on November 22, 2015, 01:49:29 pm

Title: #define preprocessor macro bug
Post by: SasMaster on November 22, 2015, 01:49:29 pm
Hi All.I wonder what's the problem with preprocessor definitions inside  Build Options - > #defines . I was using a version 12.x on Ubuntu and no matter what I defined there it wasn't getting activated inside the ide.I then updated to the latest version and it is still there.Is it a bug?Is anyone aware of it?

Thanks.
Title: Re: #define preprocessor macro bug
Post by: cacb on November 22, 2015, 02:49:42 pm
I use that feature on Windows and Linux and it works the way I expect it to work. Maybe you have more specific information on the problem you are seeing?
Title: Re: #define preprocessor macro bug
Post by: stahta01 on November 22, 2015, 05:59:42 pm
FYI: If you are using a custom makefile project then the defines do NOT effect the makefile.

Tim S.
Title: Re: #define preprocessor macro bug
Post by: SasMaster on November 24, 2015, 02:56:50 pm
Nope,I am just putting my defines into "#defines" dialog.But they are not reflected in the editor.The compiler "sees" them as the compilations proceeds according to the flags.
Title: Re: #define preprocessor macro bug
Post by: BlueHazzard on November 24, 2015, 03:01:03 pm
are you talking about editor or compilation?

They are not reflected in the code coloring in the editor, because the editor uses the code highlighting from scintilla and this component has (yet, patches are welcome) no information about the build settings.
If you are talking about compilation i would suggest that you post a full rebuild log here, so we can see what is going on...

greetings
Title: Re: #define preprocessor macro bug
Post by: SasMaster on November 24, 2015, 04:51:09 pm
I am talking about the editor.The compilation is completely all right.So you say that the editor doesn't support active macro blocks color?
Title: Re: #define preprocessor macro bug
Post by: BlueHazzard on November 24, 2015, 06:25:05 pm
I have to take back my comment. I looked into the code, and there is a working function, that collects the defines from the project file and updates the code highlighting. And it is also working for me. But i had to switch to a other target and then back to trigger the update mechanism (It gets triggered on "activate target" "activate project" and "loading workspace complete" events")

what version are you using? Have you tried a nightly build (remember 13.12 is nearly 2 years old)? If you can't try a nightly, i think in December will be the next release (see http://forums.codeblocks.org/index.php/topic,20730.msg141268/topicseen.html#msg141268)

greetings