Generating Args command line with gcc?

I have the following code:

gcc test.c -o test -D ARGUMENT 2

and I want it to define ARGUMENT with a value of 2, but it says it can't find file 2 or whatever. How to do it?

+2


source to share


3 answers


Try



-DARGUMENT = 2

+12


source


gcc test.c -o test -D ARGUMENT=2



0


source


You can also use gcc test.c -o test -DARGUMENT

.

ARGUMENT will be defined without value, but you can still check it with help #ifdef

and friends.

0


source







All Articles