![]() |
|
#1
|
|||
|
|||
Help with -D flag in make fileI am using GNU compiler on redhat linux.
I used the -D flag in my makefile to set a #define. it is used -DDEBUG_FLAG etc etc In my code where I specify #ifdef DEBUG_FLAG do debug printing #else print "debug _flag is off" #endif If the -DDEBUG_FLAG is in the make file the code compiles and runs as expected. When I remove the -DDEBUG_FLAG I get a compiler error that the variable DEBUG_FLAG is unidentified. at the #ifdef statement. I want a global flag set and thought this was the easiest way to implement it. Any suggestions to get what I have implemented to work?? Or alternative suggestions. Thanks EMP |
|||
|
#2
|
|||
|
|||
Re: Help with -D flag in make filePlease post your code and complete make file to here with code tags surrounded.
|
|
#3
|
|||
|
|||
Re: Help with -D flag in make fileQuote:
Sounds like a reasonable thing to try. Here's how I might do it. (There are, undoubtedly, other ways.) CPP / C++ / C Code:
Here's the Makefile: Code:
Here's what happens when I make it and execute Code:
Now comment out the FLAG line in the Makefile: Code:
Then Code:
Now, leave it commented out and change the command line to make: Code:
Regards, Dave |
Recent GIDBlog
Problems with the Navy (Chiefs) by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| run script command on ns2.26 | newbie06 | Computer Software Forum - Linux | 65 | 19-Aug-2009 08:50 |
| Airport Log program using 3D linked List : problem reading from file | batrsau | C Programming Language | 11 | 29-Feb-2008 08:44 |
| After execution - Error cannot locate /Skin File? | WSCH | C++ Forum | 1 | 05-Mar-2005 21:03 |
| CD Buring Failed | skanth2000 | Computer Hardware Forum | 1 | 15-Nov-2003 04:52 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The