Code::Blocks

User forums => Help => Topic started by: visir on January 15, 2018, 09:42:56 am

Title: How to include "config.h" defines?
Post by: visir on January 15, 2018, 09:42:56 am
Hello. I have a "config.h" file, generated by a "configure" script. I want codeblocks to highlight the code according to #defines in it.

I don't use codeblocks to actually build anything, I use it for the debugger. I have set it to "this is a custom makefile", and makefile is set to "NOTHING", so that I don't accidentally break anything by pressing "compile". The side effect of it is that I can't set my custom #defines anymore.

The program I'm studying right now is ffmpeg.
Title: Re: How to include "config.h" defines?
Post by: BlueHazzard on January 15, 2018, 12:57:17 pm
the define highlighting in codeblocks is really rudimentary, and i think it only works as a per file basis (but i am not sure about this)
Title: Re: How to include "config.h" defines?
Post by: visir on January 20, 2018, 10:42:22 am
What is the format of codeblocks #defines?

#define CONFIG_AVDEVICE 1

#define CONFIG_AVDEVICE=1

#define CONFIG_AVDEVICE="1"

CONFIG_AVDEVICE=1

Title: Re: How to include "config.h" defines?
Post by: stahta01 on January 20, 2018, 02:34:08 pm
What is the format of codeblocks #defines?

#define CONFIG_AVDEVICE 1

#define CONFIG_AVDEVICE=1

#define CONFIG_AVDEVICE="1"

CONFIG_AVDEVICE=1

Edit: Inside the CB GUI it is "CONFIG_AVDEVICE=1" without the double quotes.

Tim S.
Title: Re: How to include "config.h" defines?
Post by: visir on January 21, 2018, 08:21:30 am
#define seems to have worked too. Really glad for that, I just copypasted everything as is.