tags:

views:

114

answers:

3

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 cannot find file 2 or something. How do I do this?

+10  A: 

Try

-DARGUMENT=2

jldupont
I feel like an idiot! Thanks!
Bob Dylan
no, like a rolling stone
LB
@bob: it happens even to the best.
jldupont
A: 

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

Tordek
A: 

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

ARGUMENT will be defined with no value but it is still possible to check it using #ifdef and friends.

eyalm