Author Topic: How to include "config.h" defines?  (Read 553 times)

Offline visir

  • Multiple posting newcomer
  • *
  • Posts: 76
How to include "config.h" defines?
« 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.

Offline BlueHazzard

  • Lives here!
  • ****
  • Posts: 1830
Re: How to include "config.h" defines?
« Reply #1 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)

Offline visir

  • Multiple posting newcomer
  • *
  • Posts: 76
Re: How to include "config.h" defines?
« Reply #2 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


Online stahta01

  • Lives here!
  • ****
  • Posts: 6195
    • My Best Post
Re: How to include "config.h" defines?
« Reply #3 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.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Testing, compiling CB Trunk against wxWidgets 3.0.2.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline visir

  • Multiple posting newcomer
  • *
  • Posts: 76
Re: How to include "config.h" defines?
« Reply #4 on: January 21, 2018, 08:21:30 am »
#define seems to have worked too. Really glad for that, I just copypasted everything as is.