User forums > General (but related to Code::Blocks)

How i can tell CB that a define name is true or false?

(1/1)

dkaip:
Hello.
I am trying to find how to set a define name true or false.
Making same libs we put for example ...

is_debug = false
is_component_build = false

If i try to put all sources in C:B how i must put that defines in Build>#defines session?

Thank you.
Jim

BlueHazzard:
I do not understand your question fully... If the following answer does not solve your problem try to rephrase it, or give a example command line for gcc, or add screenshots..

If you want to add defines to the compiler settings you can add them to
Project->Build options->Select the project name on the left->Compiler->#defines->add

i do not think the preprocessor understands "true" and "false".. i would use "1" and "0"

dkaip:
For example if i must run a cpp file with pdfium lib, pdfium lib made with ninja and some setting in settings file args.gn like...


--- Code: ---is_debug = false
pdf_is_standalone = true

--- End code ---

How i can put in #define tab if i have all library sources in my project?
Suppose i put like ...

--- Code: ---is_debug = 0
pdf_is_standalone = 1

--- End code ---

In source file we put all that as...


--- Code: ---#define is_debug false
#define pdf_is_standalone true

--- End code ---

Thank you
Jim

BlueHazzard:

--- Quote from: dkaip on September 22, 2018, 10:49:29 pm ---How i can put in #define tab if i have all library sources in my project?
Suppose i put like ...

--- Code: ---is_debug = 0
pdf_is_standalone = 1

--- End code ---

--- End quote ---
well i assume yes. But if "true" and "false" works in your old build, then it will also work in codeblocks

Navigation

[0] Message Index

Go to full version