Click to See Complete Forum and Search --> : defines on the commandline


saai
10-12-2000, 10:51 PM
I would like to be able to pass a #define to all of my files in my current project through the command line (maybe using gcc/g++, or make?), instead of putting the #define in an actual file.
Does anyone know how to do this?
I have made a debug logging function that i only want included when im doing debug stuff - being able to add a #define to my files when i run gcc/g++ would be great.

Thanks a lot,

saai

Strike
10-13-2000, 12:07 AM
I think the -D option for the compilers will do it for you. Like you can set a variable in your Makefile with all the compiler options and put -D <whatever> in it.