Defining and undefining #defines from command line
John (Eljay) Love-Jensen
eljay@adobe.com
Fri Nov 20 12:45:00 GMT 2009
Hi José,
The -UAGE will not undefine #define's in your source code.
The -UAGE will undefine predefines by GCC. (Or undefine -DAGE that occurred earlier in the command line.)
This is what you are trying to do:
#include<stdio.h>
#ifndef AGE
#define AGE 29
#endif
int main()
{
printf("Hello, I'm %d years old\n",AGE);
return 0;
}
gcc -DAGE=30 hello.c -o hello
HTH,
--Eljay
More information about the Gcc-help
mailing list