News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

passing string as "Custom variables" or "#define" breaks the CB

Started by shenc, February 03, 2017, 10:00:13 PM

Previous topic - Next topic

shenc

I need to pass a version string from makefile so I define it as -DVERSION='"1.1.1.0"' in "Other compiler option"  or in "#defines" field as VERSION='"1.1.1.0"'.  It breaks CB, CB does not compile.  If I remove this string  CB compiles.  So I am sure it is this string breaks CB.
I also tried
-DVERSION='\"1.1.1.0\"'
-DVERSION=\'"1.1.1.0"\'

only
-DVERSION=\'"1.1.1.0"\'

works.


oBFusCATed

(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

shenc

CB does not compile.  BTW, when I copy the project to other location.  CB changes \'"1.1.1.0"\'  to /'"1.1.1.0"/'  by itself.  I need change it back to \'"1.1.1.0"\' to compile.  The behavior is verified.  I think it is a bug.


oBFusCATed

My magic ball is broken. Please describe the problem in better detail!
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

sodev

The question is most likely how to properly quote #defines in the compiler settings to define a value for a #define that wouldnt work in a plain way e.g. if it contains spaces. Various forms of different quoting either break the assembly of the compile command so that strange errors happen or CodeBlocks habits to switch path separators around break the quoting.